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 1
1
import { cropText } from '../../../utils'
2
2
import { config } from '../index.mjs'
3
3
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
7
8
}
8
9
9
10
export default {
@@ -46,7 +47,7 @@ export default {
46
47
let subtitleContent = ''
47
48
while ( subtitleData . indexOf ( '">' ) !== - 1 ) {
48
49
subtitleData = subtitleData . substring ( subtitleData . indexOf ( '">' ) + 2 )
49
- subtitleContent += subtitleData . substring ( 0 , subtitleData . indexOf ( '<' ) ) + ' '
50
+ subtitleContent += subtitleData . substring ( 0 , subtitleData . indexOf ( '<' ) ) + ', '
50
51
}
51
52
52
53
subtitleContent = replaceHtmlEntities ( subtitleContent )
You can’t perform that action at this time.
0 commit comments