[YAML Highlight] # inside strings is treated as comment
See original GitHub issueIn YAML, the #
for comments can appear inside strings which are enclosed with "
or '
Github formatting:
# comment
foo: "#bar"
foo: "bar"
Prism:
I understand it is because https://github.com/PrismJS/prism/blob/gh-pages/components/prism-yaml.js#L7 is too greedy. But Im not sure how to change it. Would look behind for "
or '
be sufficient?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
YAML - Comments - Tutorialspoint
Features of Comments Comments must not appear inside scalars. YAML does not include any way to escape the hash symbol (#) so within...
Read more >YAML: Do I need quotes for strings in YAML? - Stack Overflow
the YAML cookbook says: Enclosing strings in double quotes allows you to use escaping to represent ASCII and Unicode characters. Does this mean...
Read more >Strings in YAML - To Quote or not to Quote | tinita [blogs.perl.org]
Any character except ' will be returned literally. You can not use escapes sequences here. ... So the # the end of the...
Read more >How to use YAML nesting, lists, and comments in Ansible ...
Identify comments by using the hash ( # ) symbol. YAML strings can be represented within single or double quotes. For multiline strings,...
Read more >Highlighting YAML comments correctly - Emacs Stack Exchange
s ?\t)) , as in: (defun yaml-mode-syntax-propertize-function (beg end) (save-excursion (goto-char beg) (while (search-forward "#" end t) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed by #1095
Awesome to see some progress on this! Agree I had many issues with greedy behavior before so excited to see how @zeitgeist87’s tweaks work