Grammar Injection doesn't not work on multi-line content
See original GitHub issueFrom @zh4ui on October 29, 2017 13:8
I tried to inject TOML grammar into markdown, however the TOML colorizer only works on the first line (i.e. a = “b” in the image), it doesn’t work on the following line (i.e. d = “c” in the image)
My tmLanguage.json for the injection is like:
{
"fileTypes": [],
"injectionSelector": "text.html.markdown",
"name": "tomlfrontmatter",
"patterns": [
{
"begin": "\\Abegin\\s*",
"end": "(^|\\G)end\\s*$",
"patterns": [
{
"include": "source.toml"
}
]
}
],
"scopeName": "toml.frontmatter.markdown"
}
The complete source code is at: https://github.com/zh4ui/vscode-markdowntoml.git
- VSCode Version: Version 1.17.2 (1.17.2)
- OS Version: macOS 10.13 (17A405)
Steps to Reproduce:
- install the Better TOML for TOML colorizer
- git clone https://github.com/zh4ui/vscode-markdowntoml.git
- cd vscode-markdowntoml && code .
- F5 to debug the code
- Create a markdown file in the [Extension Development Host]
- type in the content
begin a = "b"
c = "d"
end
Reproduces without extensions: No
Copied from original issue: Microsoft/vscode#37098
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Multiline comments in VS Code for Raku - github
First off, I presume the [ "/*", "*/" ], line should be deleted. Raku doesn't support that form of block commenting. Next, having...
Read more >Please, Java. Do Finally Support Multiline String Literals
Yes. I don't understand why Java still doesn't have multiline string literals. How often do you write JDBC code (or whatever other external ......
Read more >YAML Multiline Strings
They can be in the string, but : cannot appear before a space or newline, and # cannot appear after a space or...
Read more >How can I filter a view using a blank multi-line field?
For Multiline plain text fields just doing [Field] contains '' won't work. Instead, setup the view with all the columns you want, sorting,...
Read more >Ruby Style Guide
Indent succeeding lines in multi-line boolean expressions. ... the comment describes the function, it does not tell the function what to do.
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
Okay. Writing a TextMate Grammar: Some Lessons Learned gives a fairly good explanation about “begin…end” and “begin…while”.
I am wondering is there a plan for vscode-textmate to support “begin…while”?
@colinfang
Yes, markdown-it only deals with markdown preview. So I gave up trying.
I’ve got an impression that currently grammar injection is just a hack, rather than a useable feature.