Answer the question
In order to leave comments, you need to log in
How to compare two versions of marked up text at the word level?
The general task before me is as follows:
there are two files with marked-up text, or rather one file and one diff, which was issued by the hard currency.
It is necessary to compile a correct (according to the markup language) file from them, in which both versions are included, common parts are not duplicated, different parts are framed with special tags.
In this case, changes in words should be distinguished at the word level.
For example,
Файл 1:
<h1>Заголовок</h1>
Подзаголовок
Мама мыла раму.
Не было тучь на небе.
Файл 2:
<h1>Название</h1>
<h2>Подзаголовок</h2>
Мама мыла пуделя.
В небе были тучи.
Результат:
<h1><span class=old>Заголовок</span> <span class=new>Название</span><h1>
<h2>Подзаголовок</h2>
Мама мыла <span class=old>раму</span> <span class=new>пуделя</span>.
<span class=old>Не было тучь на небе.</span>
<span class=new>В небе были тучи.</span>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question