C4 - Cultural and sCientific Content in Context - is the EEXCESS context detection framework written in JavaScript. It provides supporting functionionality to enable easy user mining and querying for all EEXCESS clients. It supports for example Named Entity Recognition using the DOSeR Service, paragraph detection, Citation Buidling etc.
If I remember correctly, a selection can only be set as paragraph, if it starts and ends within the same DOM-element. I think I have found a possible solution to overcome this issue:
A new div could be added to the body, with position:absolute. This div should provide the visual bounding box for the selected paragraphs. Thus, it may not wrap these paragraphs (and crash) the layout, but act as an overlay to these paragraphs, with the top left corner position being the same as the top left corner of the top left element in the selection. With and height need to be adjusted such, that the div ends at the bottom right corner of the bottom right element in the selection. The newly added div should have transparent background and should be passed to the provided function for the "set as paragraph" function (as then the caller can set a border as desired).
If I remember correctly, a selection can only be set as paragraph, if it starts and ends within the same DOM-element. I think I have found a possible solution to overcome this issue: A new div could be added to the body, with position:absolute. This div should provide the visual bounding box for the selected paragraphs. Thus, it may not wrap these paragraphs (and crash) the layout, but act as an overlay to these paragraphs, with the top left corner position being the same as the top left corner of the top left element in the selection. With and height need to be adjusted such, that the div ends at the bottom right corner of the bottom right element in the selection. The newly added div should have transparent background and should be passed to the provided function for the "set as paragraph" function (as then the caller can set a border as desired).