#847 fix for case texts with multiple br tags, explanation in usage doc on how to avoid labels out of bounds.

This commit is contained in:
knsv
2019-07-16 16:05:22 -07:00
parent 976d16b0db
commit 8e27318eda
3 changed files with 16 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ const sanitize = text => {
let txt = text
if (config.securityLevel === 'strict') {
txt = txt.replace(/<br>/g, '#br#')
txt = txt.replace(/<br\S*\/>/g, '#br#')
txt = txt.replace(/<br\S*?\/>/g, '#br#')
txt = txt.replace(/</g, '&lt;').replace(/>/g, '&gt;')
txt = txt.replace(/#br#/g, '<br/>')
}