5

There are some questions on SO about Html diff engines, but i cant find right answer. What i need is .NET library for comparing two rendered html strings and displaying diff (like SO renders questions/answer editing revisions (example)).

Community
  • 1
  • 1
admax
  • 1,671
  • 2
  • 16
  • 23
  • SO stores and diffs plain text (formatted using markdown) and not the rendered HTML. – Lucero Jun 02 '10 at 09:58
  • I don't understand what you mean by displaying "rendered" strings: surely you don't mean comparing pixel-by-pixel, so what do you mean? What's the difference between html and rendered html? – ChrisW Jun 02 '10 at 10:31
  • If SO compares plain text than markdown specific characters could be treated as normal text. And this is not right. For example, difference between `**some text**` and `*some text added*` wil be **some text added** But should be *some text added* – admax Jun 02 '10 at 10:38
  • @ChrisW "Rendered HTML" means that i need to compare not html source (like plain text) but rendered murkup. i.e. comparator should be aware of markup-specific characters and skip/process it. – admax Jun 02 '10 at 10:50
  • I still don't know what you mean, by "markup-specific characters". But anyway, maybe a library which does XML-differencing (comparing two XML node-document-trees, instead of comparing two XML serialized-text-files) might be something like what you'd want: so "XML" might be something else to search for, as well as or instead of "HTML". – ChrisW Jun 02 '10 at 12:03
  • Possibly similar question: http://stackoverflow.com/questions/1061468/html-compare – rjmunro Nov 17 '11 at 11:57
  • Duplicate of http://stackoverflow.com/q/31722/694325 ? – Joel Peltonen Dec 10 '12 at 14:05

1 Answers1

9

Accepts HTML, outputs HTML:

Accepts HTML, outputs a data structure:

Zoë Peterson
  • 13,094
  • 2
  • 44
  • 64