@@ -6,19 +6,12 @@ import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.ts';
66import { initViewedCheckboxListenerFor , countAndUpdateViewedFiles , initExpandAndCollapseFilesButton } from './pull-view-file.ts' ;
77import { initImageDiff } from './imagediff.ts' ;
88import { showErrorToast } from '../modules/toast.ts' ;
9- import {
10- submitEventSubmitter ,
11- queryElemSiblings ,
12- hideElem ,
13- showElem ,
14- animateOnce ,
15- addDelegatedEventListener ,
16- createElementFromHTML , queryElems ,
17- } from '../utils/dom.ts' ;
9+ import { submitEventSubmitter , queryElemSiblings , hideElem , showElem , animateOnce , addDelegatedEventListener , createElementFromHTML , queryElems } from '../utils/dom.ts' ;
1810import { POST , GET } from '../modules/fetch.ts' ;
1911import { fomanticQuery } from '../modules/fomantic/base.ts' ;
2012import { createTippy } from '../modules/tippy.ts' ;
2113import { invertFileFolding } from './file-fold.ts' ;
14+ import { parseDom } from '../utils.ts' ;
2215
2316const { i18n} = window . config ;
2417
@@ -174,7 +167,7 @@ async function loadMoreFiles(btn: Element): Promise<boolean> {
174167 try {
175168 const response = await GET ( url ) ;
176169 const resp = await response . text ( ) ;
177- const respDoc = new DOMParser ( ) . parseFromString ( resp , 'text/html' ) ;
170+ const respDoc = parseDom ( resp , 'text/html' ) ;
178171 const respFileBoxes = respDoc . querySelector ( '#diff-file-boxes' ) ;
179172 // the response is a full HTML page, we need to extract the relevant contents:
180173 // * append the newly loaded file list items to the existing list
@@ -206,7 +199,7 @@ function initRepoDiffShowMore() {
206199 try {
207200 const response = await GET ( url ) ;
208201 const resp = await response . text ( ) ;
209- const respDoc = new DOMParser ( ) . parseFromString ( resp , 'text/html' ) ;
202+ const respDoc = parseDom ( resp , 'text/html' ) ;
210203 const respFileBody = respDoc . querySelector ( '#diff-file-boxes .diff-file-body .file-body' ) ;
211204 el . parentElement . replaceWith ( ...Array . from ( respFileBody . children ) ) ;
212205 // FIXME: calling onShowMoreFiles is not quite right here.
0 commit comments