fix: remove font tags

This commit is contained in:
Maria Schreiber
2017-11-22 18:44:29 -05:00
parent e3deddf3c2
commit 2e77d7f497

View File

@@ -46,10 +46,12 @@ export async function getSubtitles({
const [, start] = startRegex.exec(line);
const [, dur] = durRegex.exec(line);
const fontTag = new RegExp('<'+'font'+'[^><]*>|<.'+'font'+'[^><]*>','g');
const htmlText = line
.replace(/<text.+>/, '')
.replace(/&amp;/gi, '&')
.replace(/<\/?[^>]+(>|$)/g, '');
.replace(/<\/?[^>]+(>|$)/g, '')
.replace(fontTag, '');
const text = he.decode(htmlText);