Skip to content

Commit

Permalink
ConTeXt writer: tag paragraphs
Browse files Browse the repository at this point in the history
Paragraphs are enclosed by `\startparagraph` and `\stopparagraph`
commands. This ensures better tagging results in PDF output.
  • Loading branch information
tarleb committed Jun 6, 2022
1 parent 9d268e5 commit e6b94df
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/ConTeXt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ blockToConTeXt (SimpleFigure attr txt (src, _)) = do
return $ blankline $$ "\\placefigure" <> label <> braces capt <> img <> blankline
blockToConTeXt (Para lst) = do
contents <- inlineListToConTeXt lst
return $ contents <> blankline
return $ "\\bpar" $$ contents $$ "\\epar" <> blankline
blockToConTeXt (LineBlock lns) = do
let emptyToBlankline doc = if isEmpty doc
then blankline
Expand Down
14 changes: 14 additions & 0 deletions test/tables.context
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
\bpar
Simple table with caption:
\epar

\startplacetable[title={Demonstration of simple table syntax.}]
\startxtable
Expand Down Expand Up @@ -35,7 +37,9 @@ Simple table with caption:
\stopxtable
\stopplacetable

\bpar
Simple table without caption:
\epar

\startplacetable[location=none]
\startxtable
Expand Down Expand Up @@ -72,7 +76,9 @@ Simple table without caption:
\stopxtable
\stopplacetable

\bpar
Simple table indented two spaces:
\epar

\startplacetable[title={Demonstration of simple table syntax.}]
\startxtable
Expand Down Expand Up @@ -109,7 +115,9 @@ Simple table indented two spaces:
\stopxtable
\stopplacetable

\bpar
Multiline table with caption:
\epar

\startplacetable[title={Here's the caption. It may span multiple lines.}]
\startxtable
Expand Down Expand Up @@ -142,7 +150,9 @@ blank line between rows. \stopxcell
\stopxtable
\stopplacetable

\bpar
Multiline table without caption:
\epar

\startplacetable[location=none]
\startxtable
Expand Down Expand Up @@ -175,7 +185,9 @@ blank line between rows. \stopxcell
\stopxtable
\stopplacetable

\bpar
Table without column headers:
\epar

\startplacetable[location=none]
\startxtable
Expand Down Expand Up @@ -204,7 +216,9 @@ Table without column headers:
\stopxtable
\stopplacetable

\bpar
Multiline table without column headers:
\epar

\startplacetable[location=none]
\startxtable
Expand Down
Loading

0 comments on commit e6b94df

Please sign in to comment.