guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.5k stars 245 forks source link

Blank <p> tags when content contains a table at start #300

Open aleemb opened 9 years ago

aleemb commented 9 years ago

When the content contains a table as the first element (or only element), clicking at the start of the table automatically creates a <p><br></p> node at the start.

When trying to delete the resulting gap from that node, more such nodes are just added to the start.

I have verified this bug in Chrome 39 and Firefox 33.1.1.

aleemb commented 9 years ago

Reproduction steps:

http://jsfiddle.net/L59kL1rf/

When trying to delete the first paragraph entirely, you'll end up with <p><br></p>. When trying to select the the <br> and delete that you'll end up with <p><br></p><p><br></p> and this continues each time you try to delete the first paragraph.

hmgibson23 commented 9 years ago

Thanks for pointing this one out, I'll mark it as available for someone to look at. We make almost no use of tables in our scribe use, so I'm not sure how quickly someone will get to it.

theefer commented 9 years ago

The tables in our CMS are managed outside of Scribe, so we currently don't have tables at all.

aleemb commented 9 years ago

@theefer, this could encourage mild editing and ease management of tables within scribe.

Is this specific to tables though? or does it have to do with some other bug within Scribe that affects tables and potentially other tags.

trshafer commented 9 years ago

This happens in the example as well: https://guardian.github.io/scribe/ . When all the content is deleted, the result is not an empty string but <p><br></p>. Is there a way to remove the wrapping <p></p> tags?

Thanks for this great library.