Hi all,
I have an XML file that contains some markdown in CDATA sections - I’d quite like to be able to syntax highlight the markdown, so I’ve been looking at creating a little syntax highlighting definition for this:
[code]# [PackageDev] target_format: plist, ext: tmLanguage
name: XML Markdown
scopeName: text.xmlmd
fileTypes: [xml]
uuid: 997f9221-cd9f-4544-9058-edc6952bb3d0
patterns:
-
name: markdown.raw.block.xmlmd
begin: <(content|summary|description)>
captures:
‘1’: {name: variable.language}
end: </(\1)>
patterns:- include: text.html.markdown
-
include: text.xml
…[/code]
The problem I am having is with the end
block. It is picked up correctly if there are 0-3 spaces before the end tag (</summary>
for example), but not if there are more or a tab. I’ve tried using \s*
in the end pattern as well, but that doesn’t help.
Any idea why the end pattern wouldn’t be matched based on the whitespace before it?
Thanks,
Allan