Skip to content

Commit

Permalink
feat(slb-495): minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
dspachos committed Nov 27, 2024
1 parent 527b817 commit 9899dc4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions apps/converter/htmlToMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ async function extractMainContent(htmlString) {
if (html) {
// Create a new JSDOM instance and parse the HTML string
const dom = new JSDOM(html);
// Extract the <main> element content
let mainElement = dom.window.document.querySelector('main');
if (!mainElement) {
mainElement = dom.window.document.querySelector('article');
}
const mainElement = dom.window.document.querySelector('main, article');
// Return the inner HTML of the <main> tag, or an empty string if not found
return mainElement ? mainElement.innerHTML : '';
}
Expand Down

0 comments on commit 9899dc4

Please sign in to comment.