liveblog
liveblog copied to clipboard
Multiple html code-block bug fixes
Problems:
- HTML editor blocks are being duplicated on edit, and once republished are then visible. (see gif below)
- Converting code blocks to html sometimes duplicates the containing div. See https://github.com/Automattic/liveblog/pull/503/files#diff-9e8481d2ea9020bcf8e803df71a6ca3bR22 for the problem.
Solutions:
-
Remove the inner HTML of the HTML block once the entity is created (see diff). I also had to create an eslint rule to prevent eslint from yelling at us.
-
In
React v16.2.0
you can now usereact.fragment
to not render containing divs for inner html. See https://stackoverflow.com/a/44033054 for the solution.