recogito / recogito-js

A JavaScript library for text annotation
BSD 3-Clause "New" or "Revised" License
363 stars 42 forks source link

Nest the wrapper in the body instead of around it #69

Closed rcpeters closed 2 years ago

rcpeters commented 2 years ago

Check if passed in element is the body tag. Place the wrapper inside the body tag instead of around it.

rsimon commented 2 years ago

Thanks - that's a really useful extension!

rcpeters commented 2 years ago

Just had a thought this is going to break existing pre-annotations if generated with document.body before the change? Doesn't affect me, but wanted to bring up the possible issue.

rsimon commented 2 years ago

That's true. However, RecogitoJS would have introduced a broken DOM structure (by wrapping the body) previously. So I think it's justifiable to introduce this as a (potentially) breaking change. I'll make a note in the next release notes, and will make it the 1.8 release (rather than 1.7.2).