You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work with some projects that are mostly markdown, and the pandoc plugin is the best I've found for working with markdown with language fences.
One problem I have though is with projects that use templating engines, for example, mkdocs-macros-plugin uses Jinja2. This is extremely flexible, and ultimately can be any Python code. For example:
{{ MACROS___make_table(["x", "y", "z"]) }}
Due to the triple underscore, everything is bold and italic until the next MACROS___ call:
I've fiddled around with attempting to treat these as code fences, to no avail:
diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim
index 38df7f1..d58a7d8 100644
--- a/syntax/pandoc.vim+++ b/syntax/pandoc.vim@@ -450,9 +450,10 @@ syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTabl
" this is here because we can override strikeouts and subscripts
syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
-call s:WithConceal('codeblock_start', 'syn match pandocDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars['codelang'])+syn region pandocDelimitedCodeBlock start=/{{/ end=/}}/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend+call s:WithConceal('codeblock_start', 'syn match pandocDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)\|{{/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars['codelang'])
syn match pandocDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained
-call s:WithConceal('codeblock_delim', 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock', 'conceal cchar='.s:cchars['codeend'])+call s:WithConceal('codeblock_delim', 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=\|}}/ contained containedin=pandocDelimitedCodeBlock', 'conceal cchar='.s:cchars['codeend'])
syn match pandocBlockQuoteinDelimitedCodeBlock '^>' contained containedin=pandocDelimitedCodeBlock
syn match pandocCodePre /<pre>.\{-}<\/pre>/ skipnl
syn match pandocCodePre /<code>.\{-}<\/code>/ skipnl
I don't know if this is a feature you're interested in supporting, but if you are able to point me in the right direction to solve the problem for myself, I would appreciate it very much.
The text was updated successfully, but these errors were encountered:
I work with some projects that are mostly markdown, and the pandoc plugin is the best I've found for working with markdown with language fences.
One problem I have though is with projects that use templating engines, for example, mkdocs-macros-plugin uses Jinja2. This is extremely flexible, and ultimately can be any Python code. For example:
Due to the triple underscore, everything is bold and italic until the next
MACROS___
call:I've fiddled around with attempting to treat these as code fences, to no avail:
I don't know if this is a feature you're interested in supporting, but if you are able to point me in the right direction to solve the problem for myself, I would appreciate it very much.
The text was updated successfully, but these errors were encountered: