They allow you to highlight portions of text, and assign a comment to it... So, how do you associate an object with something that changes all the time?
Does each word need to be an object? Like... the comment would just have an array of words that it's associated with? and then change what is in that array as the document is edited?
I feel like the each-word-is-an-object approach would result in a slow web app. =\
Another issue I thought of: since this is the web, there are HTML tags everywhere... what happens to HTML tags surrounding text selected for highlight? what if the start or end of the highlight starts / ends in the middle of a tag, and ends / starts outside the tag?
Obviously, I don't know how they do it. I'm just throwing an idea or two out there.
Think of it as bolding text, rather than commenting. How would you get past the tag barriers then? You'd end the bold before the closing tag, and resume it at the new opening tag.
Now you have to group those (potentially fragmented) tags somehow. That would likely be via some sort of naming convention.
<ul>
<li>This text <comment id="c1#0"> has been flagged for review.</comment></li>
<li><comment id="c1#1">And this is more text</comment>to be reviewed.</li>
</ul>
Sound reasonable? Or have I been sniffing the whiteboard markers too much today?
精彩评论