liveblog icon indicating copy to clipboard operation
liveblog copied to clipboard

Multiple html code-block bug fixes

Open cain opened this issue 6 years ago • 0 comments

Problems:

  1. HTML editor blocks are being duplicated on edit, and once republished are then visible. (see gif below)

kapture 2018-07-26 at 9 25 35

  1. 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:

  1. 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.

  2. In React v16.2.0 you can now use react.fragment to not render containing divs for inner html. See https://stackoverflow.com/a/44033054 for the solution.

cain avatar Jul 25 '18 23:07 cain