diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/markdown/markdown.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/markdown/markdown.sty | 96 |
1 files changed, 56 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty index 6f7c8cdbebf..19898298d26 100644 --- a/Master/texmf-dist/tex/latex/markdown/markdown.sty +++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty @@ -426,17 +426,17 @@ { { Default } { . } { OneParen } { ) } - { Period } { - } + { Period } { . } } } \cs_new:Nn \__markdown_latex_fancy_list_item_label:nnn { - \__markdown_latex_fancy_list_item_label_delimiter:n - { #2 } \__markdown_latex_fancy_list_item_label_number:nn { #1 } { #3 } + \__markdown_latex_fancy_list_item_label_delimiter:n + { #2 } } \cs_new:Nn \__markdown_latex_paralist_style:nn @@ -464,7 +464,16 @@ \tl_set:Nn \l__markdown_latex_fancy_list_item_label_delimiter_style_tl { #2 } - \begin{enumerate}[ \__markdown_latex_paralist_style:nn { #1 } { #2 } ] + \tl_set:Nn + \l_tmpa_tl + { \begin{enumerate}[ } + \tl_put_right:Nx + \l_tmpa_tl + { \__markdown_latex_paralist_style:nn { #1 } { #2 } } + \tl_put_right:Nn + \l_tmpa_tl + { ] } + \l_tmpa_tl }, fancyOlEnd = { \end{enumerate} @@ -480,20 +489,29 @@ \tl_set:Nn \l__markdown_latex_fancy_list_item_label_delimiter_style_tl { #2 } - \begin{compactenum}[ \__markdown_latex_paralist_style:nn { #1 } { #2 } ] + \tl_set:Nn + \l_tmpa_tl + { \begin{compactenum}[ } + \tl_put_right:Nx + \l_tmpa_tl + { \__markdown_latex_paralist_style:nn { #1 } { #2 } } + \tl_put_right:Nn + \l_tmpa_tl + { ] } + \l_tmpa_tl }, fancyOlEndTight = { \end{compactenum} \group_end: }, fancyOlItemWithNumber = { - \markdownRendererOlItemWithNumber - { + \item + [ \__markdown_latex_fancy_list_item_label:VVn \l__markdown_latex_fancy_list_item_label_number_style_tl \l__markdown_latex_fancy_list_item_label_delimiter_style_tl { #1 } - } + ] }, dlBeginTight = {\begin{compactdesc}}, dlEndTight = {\end{compactdesc}}}} @@ -558,8 +576,10 @@ }{% \ifthenelse{\equal{#1}{tex}}{% \catcode`\%=14\relax + \catcode`\#=6\relax \input #3\relax \catcode`\%=12\relax + \catcode`\#=12\relax }{% \markdownInput{#3}% }% @@ -624,7 +644,9 @@ \lstinputlisting[language=#2]{#1}% }% }{% + \catcode`\#=6\relax \inputminted{#2}{#1}% + \catcode`\#=12\relax }% \fi}, horizontalRule = {\noindent\rule[0.5ex]{\linewidth}{1pt}}, @@ -923,38 +945,32 @@ \RequirePackage{url} \RequirePackage{expl3} \ExplSyntaxOn -\def\markdownRendererLinkPrototype{ - \begingroup - \catcode`\#=12 - \def\next##1##2##3##4{ - \endgroup - \tl_set:Nn \l_tmpa_tl { ##1 } - \tl_set:Nn \l_tmpb_tl { ##2 } - \bool_set:Nn - \l_tmpa_bool - { - \tl_if_eq_p:NN - \l_tmpa_tl - \l_tmpb_tl - } - \tl_set:Nn \l_tmpa_tl { ##4 } - \bool_set:Nn - \l_tmpb_bool - { - \tl_if_empty_p:N - \l_tmpa_tl - } - \bool_if:nTF - { - \l_tmpa_bool && \l_tmpb_bool - } - { - \markdownLaTeXRendererAutolink { ##2 } { ##3 } - }{ - \markdownLaTeXRendererDirectOrIndirectLink { ##1 } { ##2 } { ##3 } { ##4 } - } - } - \next +\def\markdownRendererLinkPrototype#1#2#3#4{ + \tl_set:Nn \l_tmpa_tl { #1 } + \tl_set:Nn \l_tmpb_tl { #2 } + \bool_set:Nn + \l_tmpa_bool + { + \tl_if_eq_p:NN + \l_tmpa_tl + \l_tmpb_tl + } + \tl_set:Nn \l_tmpa_tl { #4 } + \bool_set:Nn + \l_tmpb_bool + { + \tl_if_empty_p:N + \l_tmpa_tl + } + \bool_if:nTF + { + \l_tmpa_bool && \l_tmpb_bool + } + { + \markdownLaTeXRendererAutolink { #2 } { #3 } + }{ + \markdownLaTeXRendererDirectOrIndirectLink { #1 } { #2 } { #3 } { #4 } + } } \def\markdownLaTeXRendererAutolink#1#2{% \tl_set:Nn |