I see that highlighter works by adding span to the selected elements. But due to this is user selects something like this <p><b> Home</b> is great </p> then highlighter fragments this one line "Home is great" into two spans i.e. "Home" and "is great" .
Hence highlighter stats gives two highlights and in per user highlight page two different lines are created like -
Can we have a solution for this please! Otherwise user just get confused when looks at own highlights because he/she dosen't know why there are multiple lines in his highlights when he clearly highlighted one line.
Unfortunately you can't highlight across multiple block-level elements like p or div tags without the engine creating multiple highlights - otherwise it would break the layout of the page and ruin the presentation. I had looked into ways around that, but due to the way the highlighter currently wraps highlights in spans it simply isn't possible. Down the road in a future update it's possible I will rework the way the engine does this, but there isn't a simple solution at this time.
Thank you for reply. But it is nearly impossible to write articles without using some elements like bold or italic. Which effects usability of this very much. Can we have a solution to just skip these basic elements.
ok. Can you please see this page https://blog.emumba.com/how-to-let-users-highlight-your-html-c1013abf68fb?token=z9zhAyC1obWJAudE . I highlighted text here and they are adding just one span overall.
Can't we add an attribute for auto created spans. So that while retrieving all the span we can check
If(attribute_flag is set)
skip adding class in shortcode view
so that auto split span get written in same line and HTML is not broken.
bold and italic are not block-level elements, so those shouldn't affect the highlighter spans. Are you noticing this is the case?
yes. problem is also with bold and italics.
hmm, well that is something we're going to have to add to our list of future theme updates. I appreciate you pointing that out.