Editor: quantities inside {} are not highlighted
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 109
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 19
Description
Found while reviewing the fix for #490.
`static/js/src/cooklang-mode.js` returns `"measurement"` for the quantity part of `{200%g}` (and `"unit"` only after `%`). `measurement` is not a Lezer highlight tag, so CodeMirror logs "Unknown highlighting tag measurement" and the number gets no class or colour; only the unit is styled.
Fix: map the quantity to a real tag (e.g. `t.number`) and give it a `.cm-cook-quantity` class in `static/css/input.css` on a token colour.
Contributor guide
Research direction
Start in static/js/src/cooklang-mode.js and inspect how the quantity and unit parts of `{200%g}` are tagged, then check the editor for the reported highlighting warning. Update the quantity mapping and its styling in static/css/input.css; done means the quantity is coloured with a class and no unknown-tag warning is logged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100