feat(controller): add keepSemanticTags config to keep the semantic structure of the page

This commit is contained in:
Simon
2026-04-03 19:01:54 +08:00
parent 6630774dc9
commit 7e9027167d
4 changed files with 65 additions and 5 deletions

View File

@@ -193,7 +193,11 @@ export class PageController extends EventTarget {
interactiveBlacklist: blacklist,
})
this.simplifiedHTML = dom.flatTreeToString(this.flatTree, this.config.includeAttributes)
this.simplifiedHTML = dom.flatTreeToString(
this.flatTree,
this.config.includeAttributes,
this.config.keepSemanticTags
)
this.selectorMap.clear()
this.selectorMap = dom.getSelectorMap(this.flatTree)