Closed TotallyInformation closed 3 years ago
The following config should be working:
"folding": {
"html": {
"beginRegex": "<([a-zA-Z]+)",
"endRegex": "<\\/\\1>",
},
}
Hi, thanks for the quick reply.
No, that doesn't work either.
Here what I get:
What do you have?
Urm, odd - I got a single fold there. 2 others lower down as well. Seems random.
Not sure if it helps, but here is the full file:
https://github.com/TotallyInformation/node-red-contrib-uibuilder/blob/main/nodes/uibuilder.html
It was due to <input
which doesn't have a closing tag...
The following config is giving me:
"folding": {
"html": {
"beginRegex": "<(?!area|base|br|col|embed|hr|img|input|link|menuitem|meta|param|source|track|wbr)([a-zA-Z]+)[^>\\/]*>",
"endRegex": "<\\/\\1>"
},
}
(?!area|base|br|col|embed|hr|img|input|link|menuitem|meta|param|source|track|wbr)
is excluding void html tags so they won't be matched as opening tags.
[^>\\/]*>
is excluding self-closed tags.
Fantastic - many thanks for that. Great job.
Describe the bug
When editing HTML using VScode's
auto
folding. Nested html elements do not seem to fold when they are inside a<script>
element. I've already used this extension to add JSDoc folding to javascript files but I cannot find a setting that lets me fold nested html elements inside the script element.Note how folding works OK for the nested para elements but not inside script.
To reproduce
Code Example
Settings
OR
Note, however, that the following DOES work, but obviously only for the para element, not for anything else:
Expected behavior
Folding should occur within an outer
<script>
elementScreenshots
See above
Additional context
If you were able to add an
indent
option so that we could turn on indentation folding as well as specific folding, that would also fix this and other issues.Reference to the issue I've raised in VScode as well that relates to this issue: https://github.com/microsoft/vscode/issues/116652