开发者

How does google docs do their commenting? [closed]

开发者 https://www.devze.com 2023-04-04 08:57 出处:网络
It's difficult to tell what is being 开发者_如何学Goasked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
It's difficult to tell what is being 开发者_如何学Goasked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消