summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/markdown/markdown.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/markdown/markdown.sty')
-rw-r--r--Master/texmf-dist/tex/latex/markdown/markdown.sty115
1 files changed, 88 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty
index 47bdd40a0df..0dede25d9cc 100644
--- a/Master/texmf-dist/tex/latex/markdown/markdown.sty
+++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty
@@ -521,9 +521,10 @@
{ NnV }
\ExplSyntaxOff
\markdownIfOption{plain}{\iffalse}{\iftrue}
-\markdownIfOption{tightLists}{
- \@ifclassloaded{beamer}{}{\RequirePackage{paralist}}%
-}{}
+\@ifclassloaded{beamer}{}{%
+ \markdownIfOption{tightLists}{\RequirePackage{paralist}}{}%
+ \markdownIfOption{fancyLists}{\RequirePackage{paralist}}{}%
+}
\ExplSyntaxOn
\@ifpackageloaded{paralist}{
\tl_new:N
@@ -735,7 +736,7 @@
emphasis = {\emph{#1}},
tickedBox = {$\boxtimes$},
halfTickedBox = {$\boxdot$},
- headerAttributeContextBegin = {
+ headerAttributeContextBegin = {%
\markdownSetup{
rendererPrototypes = {
attributeIdentifier = {%
@@ -757,29 +758,49 @@
},
}%
},
+ headerAttributeContextEnd = {},
superscript = {\textsuperscript{#1}},
subscript = {\textsubscript{#1}},
blockQuoteBegin = {\begin{quotation}},
blockQuoteEnd = {\end{quotation}},
inputVerbatim = {\VerbatimInput{#1}},
- inputFencedCode = {%
- \ifx\relax#2\relax
- \VerbatimInput{#1}%
- \else
- \@ifundefined{minted@code}{%
- \@ifundefined{lst@version}{%
- \markdownRendererInputFencedCode{#1}{}%
- }{%
- \lstinputlisting[language=#2]{#1}%
- }%
- }{%
- \catcode`\#=6\relax
- \inputminted{#2}{#1}%
- \catcode`\#=12\relax
- }%
- \fi},
thematicBreak = {\noindent\rule[0.5ex]{\linewidth}{1pt}},
note = {\footnote{#1}}}}
+\RequirePackage{ltxcmds}
+\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
+ \ltx@ifpackageloaded
+ { minted }
+ {
+ \catcode`\#=6\relax
+ \exp_args:NV
+ \inputminted
+ \l_tmpa_tl
+ { #1 }
+ \catcode`\#=12\relax
+ }
+ {
+ \ltx@ifpackageloaded
+ { listings }
+ { \lstinputlisting[language=\l_tmpa_tl]{#1} }
+ { \markdownRendererInputFencedCode{#1}{} }
+ }
+ }
+ }
+\ExplSyntaxOff
\ExplSyntaxOn
\def\markdownLATEXStrongEmphasis#1{%
\str_if_in:NnTF
@@ -1215,6 +1236,22 @@
\addto@hook\markdownLaTeXTable{#1\\}%
\expandafter\@gobble
\fi\markdownLaTeXRenderTableCell}
+
+\markdownIfOption{lineBlocks}{%
+ \RequirePackage{verse}
+ \markdownSetup{rendererPrototypes={
+ lineBlockBegin = {%
+ \begingroup
+ \def\markdownRendererLineBreak{\\}%
+ \begin{verse}%
+ },
+ lineBlockEnd = {%
+ \end{verse}%
+ \endgroup
+ },
+ }}
+}{}
+
\ExplSyntaxOn
\keys_define:nn
{ markdown/jekyllData }
@@ -1258,17 +1295,41 @@
\cs_gset:Npn
\markdownRendererInputRawInlinePrototype#1#2
{
- \str_case:nn
+ \str_case:nnF
+ { #2 }
+ {
+ { latex }
+ {
+ \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ { #1 }
+ { tex }
+ }
+ }
+ {
+ \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn
+ { #1 }
+ { #2 }
+ }
+ }
+\cs_gset:Npn
+ \markdownRendererInputRawBlockPrototype#1#2
+ {
+ \str_case:nnF
{ #2 }
{
- { tex } { \markdownEscape{#1} }
- { latex } { \markdownEscape{#1} }
- { md } { \markdownInput{#1} }
+ { latex }
+ {
+ \__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
- \markdownRendererInputRawBlockPrototype
- \markdownRendererInputRawInlinePrototype
\ExplSyntaxOff
\fi % Closes `\markdownIfOption{Plain}{\iffalse}{iftrue}`
\newcommand\markdownMakeOther{%