seankwilliams / modern-footnotes

WordPress plugin to provide inline footnotes inspired by the styles of Grantland and FiveThirtyEight
14 stars 10 forks source link

Gutenberg editing issue with tags #14

Closed seankwilliams closed 5 years ago

seankwilliams commented 5 years ago

If HTML tags are included within the text you're highlighting when choosing the "Add a Footnote" control in the Gutenberg editor, the footnotes will not be applied correctly. For example, in a sentence like:

the middle of the sentence is a link

The "Add a Footnote" option will create three distinct footnotes: "the", "middle of the sentence", and "is a link".

See https://wordpress.org/support/topic/button-of-rich-text-dont-work-correctly/ and https://wordpress.org/support/topic/an-option-to-use-normal-text-as-shortcode/#post-11228369

seankwilliams commented 5 years ago

I think we can use the boundaries for rich text at https://github.com/WordPress/gutenberg/pull/13697 to implement this somehow. Might have to get a little creative with the solution as I'm not sure Gutenberg has an out-of-the-box way to fix this.