From dcd4b33437ee2d76762844fd5b757285a0495900 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 2 Feb 2023 21:15:03 +0000 Subject: markdown (2feb23) git-svn-id: svn://tug.org/texlive/trunk@65715 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/context/third/markdown/t-markdown.tex | 70 ++++++++++++++++++---- 1 file changed, 60 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex/context') 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 -- cgit v1.2.3