highlight.js
highlight.js copied to clipboard
Improve Gherkin support
Resolves #3638 Resolves #3639
Changes
- Move keywords to mode to support keywords with spaces and those ending with a colon
- Update list of keywords (see below)
- Change
*
fromsymbol
tokeyword
since that is how it's described in the reference - Tighten variable definition to disallow whitespace
- Only recognize keywords, comments, tags, and docstrings at the beginning of a line
- Support docstrings starting with triple backticks
- Remove (non-docstring) string mode
Reference
- https://cucumber.io/docs/gherkin/reference
- https://cucumber.io/docs/gherkin/languages/#gherkin-dialect-en-content
Checklist
- [X] Added markup tests
- [X] Updated the changelog at
CHANGES.md
thanks very much
Technically all features (except variables) are only valid at the beginning of a line.
Can't we do this with multi-match and ^
(start line)? Just use the first part of the match to grab the whitespace...
and those ending with a colon
Is the colon part of the keyword though?
Updated with a new version that removes the custom keyword pattern and fixes false positives.
I couldn't figure out a good way to match for "beginning of line, skipping the whitespace" as /^[ \t]*/
triggers the "zero-width regex" error so there's currently a bunch of duplication.
Any progress for this pr?
@Hirse is this ready to go? sorry for long wait. coud you update changes.md?