diff options
author | bptato <nincsnevem662@gmail.com> | 2025-02-04 22:19:19 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2025-02-04 22:19:19 +0100 |
commit | 8af354f43a79953b9207e63e81ff8eb2713b34db (patch) | |
tree | 69ca81f56e03d3f1fcd9ccc3c9f5d3e47248903f | |
parent | 5a1a46526d4c1db2f305391b1e326f412a9c645d (diff) | |
download | chawan-8af354f43a79953b9207e63e81ff8eb2713b34db.tar.gz |
cssparser: fix parsing of consequitive comments
-rw-r--r-- | src/css/cssparser.nim | 2 | ||||
-rw-r--r-- | test/layout/double-comment-parsing.expected | 1 | ||||
-rw-r--r-- | test/layout/double-comment-parsing.html | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/css/cssparser.nim b/src/css/cssparser.nim index d5a4a558..751ff2f5 100644 --- a/src/css/cssparser.nim +++ b/src/css/cssparser.nim @@ -386,7 +386,7 @@ proc consumeIdentLikeToken(state: var CSSTokenizerState): CSSToken = return CSSToken(t: cttIdent, value: s) proc consumeComments(state: var CSSTokenizerState) = - if state.has(1) and state.peek() == '/' and state.peek(1) == '*': + while state.has(1) and state.peek() == '/' and state.peek(1) == '*': state.seek(2) while state.has() and not (state.has(1) and state.peek() == '*' and state.peek(1) == '/'): diff --git a/test/layout/double-comment-parsing.expected b/test/layout/double-comment-parsing.expected new file mode 100644 index 00000000..883dabdf --- /dev/null +++ b/test/layout/double-comment-parsing.expected @@ -0,0 +1 @@ + test diff --git a/test/layout/double-comment-parsing.html b/test/layout/double-comment-parsing.html new file mode 100644 index 00000000..1b1ab33e --- /dev/null +++ b/test/layout/double-comment-parsing.html @@ -0,0 +1,5 @@ +<style> +/**//**/ +#x { margin-left: 1ch } +</style> +<div id=x>test</div> |