diff options
author | Karl Berry <karl@freefriends.org> | 2023-02-02 21:15:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-02-02 21:15:03 +0000 |
commit | dcd4b33437ee2d76762844fd5b757285a0495900 (patch) | |
tree | 1f7ede581dffb07f22b683e1cdb16e62b1b871d1 /Master/texmf-dist/tex/generic/markdown | |
parent | bfbe2870d22742db03085257b26f5d5ea9d23e5f (diff) |
markdown (2feb23)
git-svn-id: svn://tug.org/texlive/trunk@65715 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/markdown')
-rw-r--r-- | Master/texmf-dist/tex/generic/markdown/markdown.tex | 146 |
1 files changed, 136 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/generic/markdown/markdown.tex b/Master/texmf-dist/tex/generic/markdown/markdown.tex index bc769262a08..1158fcd4e17 100644 --- a/Master/texmf-dist/tex/generic/markdown/markdown.tex +++ b/Master/texmf-dist/tex/generic/markdown/markdown.tex @@ -404,6 +404,10 @@ { boolean } { false } \__markdown_add_lua_option:nnn + { fencedCodeAttributes } + { boolean } + { false } +\__markdown_add_lua_option:nnn { fencedDivs } { boolean } { false } @@ -448,6 +452,10 @@ { boolean } { false } \__markdown_add_lua_option:nnn + { lineBlocks } + { boolean } + { false } +\__markdown_add_lua_option:nnn { footnotes } { boolean } { false } @@ -524,8 +532,8 @@ { boolean } { true } \ExplSyntaxOff -\def\markdownLastModified{2022-12-23}% -\def\markdownVersion{2.19.0-0-g80fcf20}% +\def\markdownLastModified{2023-02-01}% +\def\markdownVersion{2.20.0-0-gf64ade1}% \let\markdownBegin\relax \let\markdownEnd\relax \let\markdownInput\relax @@ -1008,6 +1016,28 @@ { strongEmphasis } { 1 } \ExplSyntaxOff +\def\markdownRendererFencedCodeAttributeContextBegin{% + \markdownRendererFencedCodeAttributeContextBeginPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { fencedCodeAttributeContextBegin } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { fencedCodeAttributeContextBegin } + { 0 } +\ExplSyntaxOff +\def\markdownRendererFencedCodeAttributeContextEnd{% + \markdownRendererFencedCodeAttributeContextEndPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { fencedCodeAttributeContextEnd } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { fencedCodeAttributeContextEnd } + { 0 } +\ExplSyntaxOff \def\markdownRendererFencedDivAttributeContextBegin{% \markdownRendererFencedDivAttributeContextBeginPrototype}% \ExplSyntaxOn @@ -1195,6 +1225,28 @@ { interblockSeparator } { 0 } \ExplSyntaxOff +\def\markdownRendererLineBlockBegin{% + \markdownRendererLineBlockBeginPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { lineBlockBegin } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { lineBlockBegin } + { 0 } +\ExplSyntaxOff +\def\markdownRendererLineBlockEnd{% + \markdownRendererLineBlockEndPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { lineBlockEnd } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { lineBlockEnd } + { 0 } +\ExplSyntaxOff \def\markdownRendererLineBreak{% \markdownRendererLineBreakPrototype}% \ExplSyntaxOn @@ -1482,6 +1534,17 @@ { inputRawBlock } { 2 } \ExplSyntaxOff +\def\markdownRendererReplacementCharacter{% + \markdownRendererReplacementCharacterPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { replacementCharacter } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { replacementCharacter } + { 0 } +\ExplSyntaxOff \def\markdownRendererLeftBrace{% \markdownRendererLeftBracePrototype}% \ExplSyntaxOn @@ -2009,12 +2072,14 @@ \def\markdownRendererDlEndTightPrototype{}% \def\markdownRendererEmphasisPrototype#1{{\it#1}}% \def\markdownRendererStrongEmphasisPrototype#1{{\bf#1}}% -\def\markdownRendererBlockQuoteBeginPrototype{\par\begingroup\it}% +\def\markdownRendererBlockQuoteBeginPrototype{\begingroup\it}% \def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}% +\def\markdownRendererLineBlockBeginPrototype{\begingroup\parindent=0pt}% +\def\markdownRendererLineBlockEndPrototype{\endgroup}% \def\markdownRendererInputVerbatimPrototype#1{% \par{\tt\input#1\relax{}}\par}% \def\markdownRendererInputFencedCodePrototype#1#2{% - \markdownRendererInputVerbatimPrototype{#1}}% + \markdownRendererInputVerbatim{#1}}% \def\markdownRendererHeadingOnePrototype#1{#1}% \def\markdownRendererHeadingTwoPrototype#1{#1}% \def\markdownRendererHeadingThreePrototype#1{#1}% @@ -2033,18 +2098,79 @@ \def\markdownRendererSubscriptPrototype#1{#1}% \ExplSyntaxOn \cs_gset:Npn - \markdownRendererInputRawInlinePrototype#1#2 + \markdownRendererHeaderAttributeContextBeginPrototype + { + \group_begin: + \color_group_begin: + } +\cs_gset:Npn + \markdownRendererHeaderAttributeContextEndPrototype + { + \color_group_end: + \group_end: + } +\cs_gset_eq:NN + \markdownRendererBracketedSpanAttributeContextBeginPrototype + \markdownRendererHeaderAttributeContextBeginPrototype +\cs_gset_eq:NN + \markdownRendererBracketedSpanAttributeContextEndPrototype + \markdownRendererHeaderAttributeContextEndPrototype +\cs_gset_eq:NN + \markdownRendererFencedDivAttributeContextBeginPrototype + \markdownRendererHeaderAttributeContextBeginPrototype +\cs_gset_eq:NN + \markdownRendererFencedDivAttributeContextEndPrototype + \markdownRendererHeaderAttributeContextEndPrototype +\cs_gset_eq:NN + \markdownRendererFencedCodeAttributeContextBeginPrototype + \markdownRendererHeaderAttributeContextBeginPrototype +\cs_gset_eq:NN + \markdownRendererFencedCodeAttributeContextEndPrototype + \markdownRendererHeaderAttributeContextEndPrototype +\cs_gset:Npn + \markdownRendererReplacementCharacterPrototype + { + % TODO: Replace with `\codepoint_generate:nn` in TeX Live 2023 + \sys_if_engine_pdftex:TF + { ^^ef^^bf^^bd } + { ^^^^fffd } + } +\ExplSyntaxOff +\ExplSyntaxOn +\cs_new:Nn + \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn { \str_case:nn { #2 } { - { tex } { \markdownEscape{#1} } { md } { \markdownInput{#1} } + { tex } { \markdownEscape{#1} \unskip } } } -\cs_gset_eq:NN - \markdownRendererInputRawBlockPrototype - \markdownRendererInputRawInlinePrototype +\cs_new:Nn + \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + { + \str_case:nn + { #2 } + { + { md } { \markdownInput{#1} } + { tex } { \markdownEscape{#1} } + } + } +\cs_gset:Npn + \markdownRendererInputRawInlinePrototype#1#2 + { + \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn + { #1 } + { #2 } + } +\cs_gset:Npn + \markdownRendererInputRawBlockPrototype#1#2 + { + \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + { #1 } + { #2 } + } \ExplSyntaxOff \ExplSyntaxOn \seq_new:N \g__markdown_jekyll_data_datatypes_seq @@ -2490,7 +2616,7 @@ [[Could not open file "&1" for reading]]) local input = assert(file:read("*a")) assert(file:close()) - print(convert(input:gsub("\r\n?", "\n") .. "\n"))}% + print(convert(input))}% |global|advance|markdownOptionFrozenCacheCounter by 1|relax }% |endgroup |