sinequa / sba-angular

Sinequa's Angular-based Search Based Application (SBA) Framework
https://sinequa.github.io/sba-angular/
MIT License
30 stars 23 forks source link

Fix the escaping of html elements passed to formatjs #109

Closed ericleib closed 1 year ago

ericleib commented 1 year ago

This PR resolves this issue: https://github.com/sinequa/sba-angular/issues/108

Currently, when formatting the message <span>foo</span><span>bar</span> we escape it with '<span>'foo'</span>''<span>'bar'</span>' (note the double ' in the middle). FormatJS leaves a single quote in the result, which is not the desired behavior.

A slight modification of the regular expression resolves the problem by escaping complete sequence of tags: '<span>'foo'</span><span>'bar'</span>'.