recogito-js
recogito-js copied to clipboard
Recogito Removes Non Breaking Spaces ( )
If you instantiate Recogito on this content:
<p>Stuff and Things</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>More Stuff and Things</p>
You end up with this:
<p>Stuff and Things</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p>More Stuff and Things</p>
Recogito removes the , causing the layout to incorrectly collapse. This is especially noticeable with tables, where the cells have a non breaking space, but the entire row collapses because the was removed.
How can I prevent Recogito from doing this? It's completely breaking table layouts for us.
The mode: 'pre' init option is what you're looking for:
https://github.com/recogito/recogito-js/wiki/API-Reference
@rsimon Hey cool, thanks! I probably should have tried that, but given the description, it didn't sound right for my use case, we aren't using pre
Set this to pre if the content is preformatted text (pre tag or white-space: pre CSS style) In pre mode, TextPositionSelectors stored in the annotations will precisely match the text formatting in the markup, whereas positions in html mode will correspond more closely to the character offsets rendered in the browser.