There are several forms on the page, where the text marked up with html-tags is inserted, but previously passed through google or Yandex translator. Translators break some tags and instead of the original <span>fish text</span> they can produce < span> рыбный текст< / span> .
Of course, such a layout is inadequately displayed in the front end. There is a code that changes the source text to the specified $('body').html($('body').html().replace(/исходник/g, 'замена')) . How to expand it so that all possible tag breaks are taken into account and they are replaced with their correct analogues? So that it was possible, or in the script, to sort through all the options, supplement it with new ones, or can something be done using regular expressions?