Hacker News new | ask | show | jobs
by yuchi 828 days ago
Let’s say you have a rich text where you want to highlight all occurrences of some token or syntax. When you have tree data structures you cannot use regexps or a simple parsers, since the full text may be split in different nodes.

With attributes strings it’s trivial, you just need to move attributes accordingly and to normalize stuff at the end.