File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/content-script/site-adapters/youtube Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11import { cropText } from '../../../utils'
22import { config } from '../index.mjs'
33
4- function replaceHtmlEntities ( htmlString ) { // This function was written by ChatGPT and modified by me (iamsirsammy)
5- const doc = new DOMParser ( ) . parseFromString ( htmlString . replace ( "&" , "&" ) , 'text/html' ) ;
6- return doc . documentElement . innerText ;
4+ // This function was written by ChatGPT and modified by iamsirsammy
5+ function replaceHtmlEntities ( htmlString ) {
6+ const doc = new DOMParser ( ) . parseFromString ( htmlString . replaceAll ( '&' , '&' ) , 'text/html' )
7+ return doc . documentElement . innerText
78}
89
910export default {
@@ -46,7 +47,7 @@ export default {
4647 let subtitleContent = ''
4748 while ( subtitleData . indexOf ( '">' ) !== - 1 ) {
4849 subtitleData = subtitleData . substring ( subtitleData . indexOf ( '">' ) + 2 )
49- subtitleContent += subtitleData . substring ( 0 , subtitleData . indexOf ( '<' ) ) + ' '
50+ subtitleContent += subtitleData . substring ( 0 , subtitleData . indexOf ( '<' ) ) + ', '
5051 }
5152
5253 subtitleContent = replaceHtmlEntities ( subtitleContent )
You can’t perform that action at this time.
0 commit comments