Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recogito Removes Non Breaking Spaces ( ) #107

Open
Petercopter opened this issue Jul 2, 2024 · 2 comments
Open

Recogito Removes Non Breaking Spaces ( ) #107

Petercopter opened this issue Jul 2, 2024 · 2 comments

Comments

@Petercopter
Copy link

If you instantiate Recogito on this content:

<p>Stuff and Things</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</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 &nbsp;, 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 &nbsp; was removed.

How can I prevent Recogito from doing this? It's completely breaking table layouts for us.

@rsimon
Copy link
Member

rsimon commented Jul 3, 2024

The mode: 'pre' init option is what you're looking for:
https://github.com/recogito/recogito-js/wiki/API-Reference

@Petercopter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants