This repository was archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 165
This repository was archived by the owner on Jun 21, 2022. It is now read-only.
CSSSyntax doesn't parse numeric range restrictions correctly #1441
Copy link
Copy link
Closed
Description
The CSS grammar supports range restrictions for numeric values of the form <integer [0,10]> (signifying a number that can have any integer value from 0...10 inclusive). Range annotations are used in two places in the MDN syntaxes.json file, so far:
- In
font-weight-absolute(since Restrict font-weight-absolute values to numbers in the 1...1000 range data#420) - In
cubic-bezier-timing-function(since restrict cubic-bezier-timing-function abscissas to be in range [0,1] data#416)
However, kumascript/macros/CSSSyntax.ejs mis-parses those annotations, resulting in corrupted HTML source such as this example from font-weight§Formal syntax:
<pre class="syntaxbox notranslate">
<a href="#font-weight-absolute"><font-weight-absolute></a>
<a href="/en-US/docs/CSS/Value_definition_syntax#Single_bar"
title="Single bar: exactly one of the entities must be present">|</a>
bolder
<a href="/en-US/docs/CSS/Value_definition_syntax#Single_bar"
title="Single bar: exactly one of the entities must be present">|</a>
lighter
<p style="font-family: Open Sans,Arial,sans-serif; margin: 10px 0 0 0;">where <br>
<code style='font-family: Consolas,Monaco,"Andale Mono",monospace;'>
<span id="font-weight-absolute"><font-weight-absolute></span>
= normal
<a href="/en-US/docs/CSS/Value_definition_syntax#Single_bar"
title="Single bar: exactly one of the entities must be present">|</a>
bold
<a href="/en-US/docs/CSS/Value_definition_syntax#Single_bar"
title="Single bar: exactly one of the entities must be present">|</a>
<number
<a href="/en-US/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to
transform them as a single component">
[1,1000
<a href="/en-US/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to
transform them as a single component">]</a>
>
</code>
</p></pre>This renders as:
<font-weight-absolute> | bolder | lighter
where
<font-weight-absolute> = normal | bold | <number <a href="/en-
US/docs/CSS/Value_definition_syntax#Brackets" title="Brackets: enclose several
entities, combinators, and multipliers to transform them as a single component">
[1,1000]>
Instead of the expected:
<font-weight-absolute> | bolder | lighter
where
<font-weight-absolute> = normal | bold | <number [1,1000]>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels