Skip to content

Commit

Permalink
[zmarkdown] Update unit tests for tables (LaTeX)
Browse files Browse the repository at this point in the history
  • Loading branch information
StaloneLab committed Apr 24, 2024
1 parent 0d16f5f commit 56a9753
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 269 deletions.
68 changes: 29 additions & 39 deletions packages/zmarkdown/__tests__/__snapshots__/latex-suite.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -561,35 +561,29 @@ exports[`mix-3 1`] = `
`;
exports[`mix-4 1`] = `
"\\\\begin{longtabu}{|m{\\\\dimexpr(\\\\linewidth) / 3 - 2 * \\\\tabcolsep}|m{\\\\dimexpr(\\\\linewidth) / 3 - 2 * \\\\tabcolsep}|m{\\\\dimexpr(\\\\linewidth) / 3 - 2 * \\\\tabcolsep}|} \\\\hline
\\\\rowfont[l]{\\\\bfseries}
Sub & Headings & \\\\abbr{ABBR}{abbreviation} \\\\\\\\ \\\\hline
\\\\rowfont[l]{}
\\\\multirow{2}{*}{\\\\parbox{\\\\linewidth}{cell \\\\endgraf spans \\\\endgraf rows}} & \\\\multicolumn{2}{|m{\\\\dimexpr(\\\\linewidth) * 2 / 3 - 2 * \\\\tabcolsep}|}{\\\\parbox{\\\\linewidth}{column spanning}} \\\\\\\\ \\\\cline{2-3}
& normal & cell \\\\\\\\ \\\\hline
multi \\\\endgraf line \\\\endgraf \\\\endgraf cells \\\\endgraf too & \\\\multicolumn{2}{|m{\\\\dimexpr(\\\\linewidth) * 2 / 3 - 2 * \\\\tabcolsep}|}{\\\\parbox{\\\\linewidth}{cells can be \\\\endgraf \\\\textit{formatted} \\\\endgraf \\\\textbf{paragraphs}}} \\\\\\\\ \\\\hline
\\\\end{longtabu}
"\\\\begin{zdstblr}{colspec={X[-1] X[-1] X[-1] X[-1]},rowhead=1,row{1}={font=\\\\bfseries}}
Sub & Headings & \\\\abbr{ABBR}{abbreviation} \\\\\\\\
\\\\SetCell[r=2]{l} cell \\\\endgraf spans \\\\endgraf rows & \\\\SetCell[c=2]{l} column spanning & \\\\\\\\
& normal & cell \\\\\\\\
multi \\\\endgraf line \\\\endgraf \\\\endgraf cells \\\\endgraf too & \\\\SetCell[c=2]{l} cells can be \\\\endgraf \\\\textit{formatted} \\\\endgraf \\\\textbf{paragraphs} & \\\\\\\\
\\\\end{zdstblr}
\\\\captionof{table}{The new table \\\\abbr{ABBR}{abbreviation} \\\\textsuperscript{\\\\protect\\\\footnotemark[1]} with \\\\keys{CTRL} + \\\\keys{S}}
\\\\footnotetext[1]{a foot}
\\\\begin{longtabu}{|m{\\\\dimexpr(\\\\linewidth) / 2 - 2 * \\\\tabcolsep}|m{\\\\dimexpr(\\\\linewidth) / 2 - 2 * \\\\tabcolsep}|} \\\\hline
\\\\rowfont[l]{\\\\bfseries}
title & image \\\\\\\\ \\\\hline
\\\\rowfont[l]{}
space & \\\\image{https://i.ytimg.com/vi/lt0WQ8JzLz4/maxresdefault.jpg}[space] \\\\\\\\ \\\\hline
\\\\end{longtabu}
\\\\begin{zdstblr}{colspec={X[-1] X[-1]},rowhead=1,row{1}={font=\\\\bfseries}}
title & image \\\\\\\\
space & \\\\image{https://i.ytimg.com/vi/lt0WQ8JzLz4/maxresdefault.jpg}[space] \\\\\\\\
\\\\end{zdstblr}
\\\\begin{longtabu}{|m{\\\\dimexpr(\\\\linewidth) / 2 - 2 * \\\\tabcolsep}|m{\\\\dimexpr(\\\\linewidth) / 2 - 2 * \\\\tabcolsep}|} \\\\hline
\\\\rowfont[l]{\\\\bfseries}
title & code \\\\\\\\ \\\\hline
\\\\rowfont[l]{}
inline & \\\\CodeInline{inline} br \\\\endgraf \\\\CodeInline{inline} \\\\\\\\ \\\\hline
block & \\\\hyperref[appendix-1]{Annexe de code 1} \\\\\\\\ \\\\hline
\\\\end{longtabu}
\\\\begin{zdstblr}{colspec={X[-1] X[-1]},rowhead=1,row{1}={font=\\\\bfseries}}
title & code \\\\\\\\
inline & \\\\CodeInline{inline} br \\\\endgraf \\\\CodeInline{inline} \\\\\\\\
block & \\\\hyperref[appendix-1]{Annexe de code 1} \\\\\\\\
\\\\end{zdstblr}
\\\\begin{appendices}
Expand Down Expand Up @@ -737,22 +731,18 @@ a
`;
exports[`table 1`] = `
"\\\\begin{longtabu} spread 0pt {|X[-1]|X[-1]|} \\\\hline
\\\\rowfont[l]{\\\\bfseries}
1 & 2 \\\\\\\\ \\\\hline
\\\\rowfont[l]{}
1 & 2 \\\\\\\\ \\\\hline
1 & 2 \\\\\\\\ \\\\hline
1 & 2 \\\\\\\\ \\\\hline
\\\\end{longtabu}
\\\\begin{longtabu} spread 0pt {|X[-1]|X[-1]|X[-1]|} \\\\hline
\\\\rowfont[l]{\\\\bfseries}
1 & 2 & 3 \\\\\\\\ \\\\hline
\\\\rowfont[l]{}
1 & 2 \\\\\\\\ \\\\hline
1 & 2 & 3 \\\\\\\\ \\\\hline
1 & 2 & 3 \\\\\\\\ \\\\hline
\\\\end{longtabu}"
"\\\\begin{zdstblr}{colspec={X[-1] X[-1]},rowhead=1,row{1}={font=\\\\bfseries}}
1 & 2 \\\\\\\\
1 & 2 \\\\\\\\
1 & 2 \\\\\\\\
1 & 2 \\\\\\\\
\\\\end{zdstblr}
\\\\begin{zdstblr}{colspec={X[-1] X[-1] X[-1]},rowhead=1,row{1}={font=\\\\bfseries}}
1 & 2 & 3 \\\\\\\\
1 & 2 \\\\\\\\
1 & 2 & 3 \\\\\\\\
1 & 2 & 3 \\\\\\\\
\\\\end{zdstblr}"
`;
Loading

0 comments on commit 56a9753

Please sign in to comment.