Editor: multi-line block comments swallow the rest of the recipe
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 109
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 19
Description
Found while reviewing the fix for #490.
In `static/js/src/cooklang-mode.js`, the block-comment closer check inside the `state.inComment` branch (`stream.match(/-]/)`) is anchored at the current stream position, so a `[- … -]` comment spanning lines never closes unless a line starts with `-]`. On `seed/Thai Green Curry.cook` every line after the block comment renders as a comment: ingredients, timers and preparation notes lose their highlighting.
Fix: search for `-]` anywhere on the line (e.g. `stream.skipTo('-]')` then `stream.match('-]')`), with a test recipe containing a multi-line block comment.
Contributor guide
Research direction
Start in static/js/src/cooklang-mode.js at the state.inComment branch and reproduce the issue with seed/Thai Green Curry.cook. Add a test recipe containing a multi-line block comment, then verify that highlighting resumes for ingredients, timers, and preparation notes after the -] closer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100