Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude committed Dec 4, 2024
1 parent 7b4312e commit 0bc7f1b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/renderers/abstract.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,12 @@ export abstract class Renderer {
* Because of CSP, some ZIM reader environments do not allow inline JS. Create a new JS script by combining
* all of the inline scripts. Not sure if the JS will still work, but it's better than just deleting it. See
* https://github.com/openzim/mwoffliner/issues/2096
*
* @param parsoidDoc
*/
private collectInlineJsImpl(parsoidDoc: DominoElement): string {
const scripts = Array.from(parsoidDoc.getElementsByTagName('script')) as DominoElement[]
let collectedJs = []
const collectedJs = []
for (const script of scripts) {
if (script.innerHTML) {
collectedJs.push(script.innerHTML)
Expand Down
1 change: 0 additions & 1 deletion src/renderers/wikimedia-mobile.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class WikimediaMobileRenderer extends MobileRenderer {
const moduleDependenciesFiltered = super.filterWikimediaMobileModules(_moduleDependencies)
let mediaDependenciesVal
let subtitlesVal
let inlineJsScriptTagVal
const mobileHTML = domino.createDocument(data)
const finalHTMLMobile = await this.pipeMobileTransformations(
mobileHTML,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/renderers/abstract.renderer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as domino from 'domino'
import { Renderer } from '../../../src/renderers/abstract.renderer'

class ConcreteRenderer extends Renderer {
public async render(renderOpts: any): Promise<any> {
public async render(): Promise<any> {
return Promise.resolve(null)
}
}
Expand Down
2 changes: 0 additions & 2 deletions test/unit/saveArticles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { VisualEditorRenderer } from '../../src/renderers/visual-editor.renderer
import { WikimediaMobileRenderer } from '../../src/renderers/wikimedia-mobile.renderer.js'
import { RestApiRenderer } from '../../src/renderers/rest-api.renderer.js'
import { RENDERERS_LIST } from '../../src/util/const.js'
import { MobileRenderer } from 'src/renderers/abstractMobile.render.js'

jest.setTimeout(40000)

Expand Down Expand Up @@ -239,7 +238,6 @@ describe('saveArticles', () => {

const articleDoc = domino.createDocument(result[0].html)

let foundInlineJsScript = false
for (const scriptTag of Array.from(articleDoc.querySelectorAll('head > script'))) {
if (scriptTag.textContent.includes('// Scripts taken')) {
expect(scriptTag.textContent.includes('onBodyStart')).toBe(true)
Expand Down

0 comments on commit 0bc7f1b

Please sign in to comment.