mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-18 12:20:15 +08:00
patch for #205
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { cropText } from '../../../utils'
|
||||
import { config } from '../index.mjs'
|
||||
|
||||
function replaceHtmlEntities(htmlString) { // This function was written by ChatGPT and modified by me (iamsirsammy)
|
||||
const doc = new DOMParser().parseFromString(htmlString.replace("&", "&"), 'text/html');
|
||||
return doc.documentElement.innerText;
|
||||
// This function was written by ChatGPT and modified by iamsirsammy
|
||||
function replaceHtmlEntities(htmlString) {
|
||||
const doc = new DOMParser().parseFromString(htmlString.replaceAll('&', '&'), 'text/html')
|
||||
return doc.documentElement.innerText
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -46,7 +47,7 @@ export default {
|
||||
let subtitleContent = ''
|
||||
while (subtitleData.indexOf('">') !== -1) {
|
||||
subtitleData = subtitleData.substring(subtitleData.indexOf('">') + 2)
|
||||
subtitleContent += subtitleData.substring(0, subtitleData.indexOf('<')) + ' '
|
||||
subtitleContent += subtitleData.substring(0, subtitleData.indexOf('<')) + ','
|
||||
}
|
||||
|
||||
subtitleContent = replaceHtmlEntities(subtitleContent)
|
||||
|
||||
Reference in New Issue
Block a user