Skip to content

Commit

Permalink
Merge pull request #358 from Baroshem/vejja/issue341
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed Jan 23, 2024
2 parents 9a27ee4 + 1a0fd1c commit 3847cb3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/runtime/nitro/plugins/02a-preprocessHtml.ts
@@ -1,5 +1,5 @@
import { defineNitroPlugin, getRouteRules } from '#imports'
import * as cheerio from 'cheerio'
import * as cheerio from 'cheerio/lib/slim'


export default defineNitroPlugin((nitroApp) => {
Expand All @@ -16,7 +16,12 @@ export default defineNitroPlugin((nitroApp) => {
const cheerios = {} as Record<Section, ReturnType<typeof cheerio.load>[]>
for (const section of sections) {
cheerios[section] = html[section].map(element => {
return cheerio.load(element, null, false)
return cheerio.load(element, {
xml: {
// Disable `xmlMode` to parse HTML with htmlparser2.
xmlMode: false,
},
}, false)
})
}
event.context.cheerios = cheerios
Expand Down

0 comments on commit 3847cb3

Please sign in to comment.