diff --git a/src/index.js b/src/index.js index 28f48bf..4a2ee81 100644 --- a/src/index.js +++ b/src/index.js @@ -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(//, '') .replace(/&/gi, '&') - .replace(/<\/?[^>]+(>|$)/g, ''); + .replace(/<\/?[^>]+(>|$)/g, '') + .replace(fontTag, ''); const text = he.decode(htmlText);