summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/third/markdown/t-markdown.tex')
-rw-r--r--Master/texmf-dist/tex/context/third/markdown/t-markdown.tex70
1 files changed, 60 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
index 79ba3273a63..9c9e035629d 100644
--- a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
+++ b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
@@ -261,13 +261,36 @@
\def\markdownRendererStrongEmphasisPrototype#1{{\bf#1}}%
\def\markdownRendererBlockQuoteBeginPrototype{\startquotation}%
\def\markdownRendererBlockQuoteEndPrototype{\stopquotation}%
+\def\markdownRendererLineBlockBeginPrototype{%
+ \begingroup
+ \def\markdownRendererLineBreak{
+ }%
+ \startlines
+}%
+\def\markdownRendererLineBlockEndPrototype{%
+ \stoplines
+ \endgroup
+}%
\def\markdownRendererInputVerbatimPrototype#1{\typefile{#1}}%
-\def\markdownRendererInputFencedCodePrototype#1#2{%
- \ifx\relax#2\relax
- \typefile{#1}%
- \else
- \typefile[#2][]{#1}%
- \fi}%
+\ExplSyntaxOn
+\cs_gset:Npn
+ \markdownRendererInputFencedCodePrototype#1#2
+ {
+ \tl_if_empty:nTF
+ { #2 }
+ { \markdownRendererInputVerbatim{#1} }
+ {
+ \regex_extract_once:nnN
+ { \w* }
+ { #2 }
+ \l_tmpa_seq
+ \seq_pop_left:NN
+ \l_tmpa_seq
+ \l_tmpa_tl
+ \typefile[\l_tmpa_tl][]{#1}
+ }
+ }
+\ExplSyntaxOff
\def\markdownRendererHeadingOnePrototype#1{\chapter{#1}}%
\def\markdownRendererHeadingTwoPrototype#1{\section{#1}}%
\def\markdownRendererHeadingThreePrototype#1{\subsection{#1}}%
@@ -352,12 +375,39 @@
\cs_gset:Npn
\markdownRendererInputRawInlinePrototype#1#2
{
- \str_case:nn
+ \str_case:nnF
{ #2 }
{
- { tex } { \markdownEscape{#1} }
- { context } { \markdownEscape{#1} }
- { md } { \markdownInput{#1} }
+ { latex }
+ {
+ \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ { #1 }
+ { context }
+ }
+ }
+ {
+ \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ { #1 }
+ { #2 }
+ }
+ }
+\cs_gset:Npn
+ \markdownRendererInputRawBlockPrototype#1#2
+ {
+ \str_case:nnF
+ { #2 }
+ {
+ { context }
+ {
+ \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn
+ { #1 }
+ { tex }
+ }
+ }
+ {
+ \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn
+ { #1 }
+ { #2 }
}
}
\cs_gset_eq:NN