From b6d364c734eb81b15eae8ff489cf3291cb6ecc9b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 30 Apr 2019 22:33:13 +0000
Subject: markdown (30apr19)

git-svn-id: svn://tug.org/texlive/trunk@50906 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/context/third/markdown/t-markdown.tex      | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)

(limited to 'Master/texmf-dist/tex/context/third/markdown/t-markdown.tex')

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 f114a6d267a..bba5f689d01 100644
--- a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
+++ b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
@@ -156,6 +156,71 @@
   \blackrule[height=1pt, width=\hsize]}%
 \def\markdownRendererFootnotePrototype#1{\footnote{#1}}%
 \stopmodule\protect
+\newcount\markdownConTeXtRowCounter
+\newcount\markdownConTeXtRowTotal
+\newcount\markdownConTeXtColumnCounter
+\newcount\markdownConTeXtColumnTotal
+\newtoks\markdownConTeXtTable
+\newtoks\markdownConTeXtTableFloat
+\def\markdownRendererTablePrototype#1#2#3{%
+  \markdownConTeXtTable={}%
+  \ifx\empty#1\empty
+    \markdownConTeXtTableFloat={%
+      \the\markdownConTeXtTable}%
+  \else
+    \markdownConTeXtTableFloat={%
+      \placetable{#1}{\the\markdownConTeXtTable}}%
+  \fi
+  \begingroup
+  \setupTABLE[r][each][topframe=off, bottomframe=off, leftframe=off, rightframe=off]
+  \setupTABLE[c][each][topframe=off, bottomframe=off, leftframe=off, rightframe=off]
+  \setupTABLE[r][1][topframe=on, bottomframe=on]
+  \setupTABLE[r][#1][bottomframe=on]
+  \markdownConTeXtRowCounter=0%
+  \markdownConTeXtRowTotal=#2%
+  \markdownConTeXtColumnTotal=#3%
+  \markdownConTeXtRenderTableRow}
+\def\markdownConTeXtRenderTableRow#1{%
+  \markdownConTeXtColumnCounter=0%
+  \ifnum\markdownConTeXtRowCounter=0\relax
+    \markdownConTeXtReadAlignments#1%
+    \markdownConTeXtTable={\bTABLE}%
+  \else
+    \markdownConTeXtTable=\expandafter{%
+      \the\markdownConTeXtTable\bTR}%
+    \markdownConTeXtRenderTableCell#1%
+    \markdownConTeXtTable=\expandafter{%
+      \the\markdownConTeXtTable\eTR}%
+  \fi
+  \advance\markdownConTeXtRowCounter by 1\relax
+  \ifnum\markdownConTeXtRowCounter>\markdownConTeXtRowTotal\relax
+    \markdownConTeXtTable=\expandafter{%
+      \the\markdownConTeXtTable\eTABLE}%
+    \the\markdownConTeXtTableFloat
+    \endgroup
+    \expandafter\gobbleoneargument
+  \fi\markdownConTeXtRenderTableRow}
+\def\markdownConTeXtReadAlignments#1{%
+  \advance\markdownConTeXtColumnCounter by 1\relax
+  \if#1d%
+    \setupTABLE[c][\the\markdownConTeXtColumnCounter][align=right]
+  \fi\if#1l%
+    \setupTABLE[c][\the\markdownConTeXtColumnCounter][align=right]
+  \fi\if#1c%
+    \setupTABLE[c][\the\markdownConTeXtColumnCounter][align=middle]
+  \fi\if#1r%
+    \setupTABLE[c][\the\markdownConTeXtColumnCounter][align=left]
+  \fi
+  \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax\else
+    \expandafter\gobbleoneargument
+  \fi\markdownConTeXtReadAlignments}
+\def\markdownConTeXtRenderTableCell#1{%
+  \advance\markdownConTeXtColumnCounter by 1\relax
+  \markdownConTeXtTable=\expandafter{%
+    \the\markdownConTeXtTable\bTD#1\eTD}%
+  \ifnum\markdownConTeXtColumnCounter<\markdownConTeXtColumnTotal\relax\else
+    \expandafter\gobbleoneargument
+  \fi\markdownConTeXtRenderTableCell}
 \endinput
 %%
 %% End of file `t-markdown.tex'.
-- 
cgit v1.2.3

