diff options
author | bptato <nincsnevem662@gmail.com> | 2022-01-25 18:11:10 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-01-25 18:32:02 +0100 |
commit | dfe56d32a0664026db3f2c3d8e018670daaf66c1 (patch) | |
tree | 6d18645572c2033ab06f83a9be8bb3a02a479a9a /src/html/parser.nim | |
parent | 8fb2b9a0a505a9051bac04ab0163b20db95b86fb (diff) | |
download | chawan-dfe56d32a0664026db3f2c3d8e018670daaf66c1.tar.gz |
Fix stylesheet containment bug
Diffstat (limited to 'src/html/parser.nim')
-rw-r--r-- | src/html/parser.nim | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/html/parser.nim b/src/html/parser.nim index 6f5ad937..d28be97b 100644 --- a/src/html/parser.nim +++ b/src/html/parser.nim @@ -307,12 +307,6 @@ proc processDocumentStartElement(state: var HTMLParseState, element: Element, ta case element.tagType of VoidTagTypes: processDocumentEndNode(state) - if element.tagType == TAG_LINK: - if HTMLLinkElement(element).s != nil: - let content = HTMLLinkElement(element).s.readAll() - HTMLLinkElement(element).sheet = parseStylesheet(content) - HTMLLinkElement(element).s.close() - HTMLLinkElement(element).parentElement.sheets.add(HTMLLinkElement(element).sheet) of TAG_LI: HTMLLIElement(element).applyOrdinal() #needs to know parent else: discard @@ -336,8 +330,8 @@ proc processDocumentEndElement(state: var HTMLParseState, tag: DOMParsedTag) = var str = "" for child in style.textNodes: str &= child.data - style.sheet = newStringStream(str).parseStylesheet() - style.parentElement.sheets.add(style.sheet) + let sheet = newStringStream(str).parseStylesheet() + style.parentElement.sheets.add(sheet) else: discard processDocumentEndNode(state) |