Return parsed dom back to backend
This commit is contained in:
@ -254,9 +254,8 @@ export const parsePreparedContent = async (
|
||||
// Format code blocks
|
||||
// TODO: we probably want to move this type of thing
|
||||
// to the handlers, and have some concept of postHandle
|
||||
if (article?.window) {
|
||||
// const cWindow = new JSDOM(article?.content).window
|
||||
article.window.document.querySelectorAll('code').forEach((e) => {
|
||||
if (article?.dom) {
|
||||
article.dom.querySelectorAll('code').forEach((e) => {
|
||||
console.log(e.textContent)
|
||||
if (e.textContent) {
|
||||
const att = hljs.highlightAuto(e.textContent)
|
||||
@ -271,7 +270,7 @@ export const parsePreparedContent = async (
|
||||
e.replaceWith(code)
|
||||
}
|
||||
})
|
||||
article.content = article.window.document.body.outerHTML
|
||||
article.content = article.dom.outerHTML
|
||||
}
|
||||
|
||||
const newWindow = new JSDOM('').window
|
||||
|
||||
Reference in New Issue
Block a user