summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHikaru Ibayashi <hikaru.ccm1023@gmail.com>2023-12-10 09:29:45 -0800
committerGitHub <noreply@github.com>2023-12-10 09:29:45 -0800
commit3be253fb90deb8ca746156a3b281e5983fc6e8cf (patch)
tree7f6474c7ff9c90d7b1e1bc2b5039830913391474 /test
parentaa9577074357c7938c5a4a7e820bd12c90c0d32b (diff)
LaTeX writer: fix bug with big footnotes inside emphasis (#9168)
Closes #8982.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/LaTeX.hs68
1 files changed, 68 insertions, 0 deletions
diff --git a/test/Tests/Writers/LaTeX.hs b/test/Tests/Writers/LaTeX.hs
index d1cec5d2b..f17dfdcce 100644
--- a/test/Tests/Writers/LaTeX.hs
+++ b/test/Tests/Writers/LaTeX.hs
@@ -86,6 +86,74 @@ tests = [ testGroup "code blocks"
, "backtick" =:
code "`nu?`" =?> "\\texttt{\\textasciigrave{}nu?\\textasciigrave{}}"
]
+ , testGroup "inline note"
+ [ "Big note in emph" =:
+ emph (str "This sentence"
+ <> note (para (str "paragraph1")
+ <> para (str "paragraph2"))
+ <> str " has footnote.")
+ =?>
+ "\\emph{This sentence}\\footnote{paragraph1\n\n paragraph2}"
+ <> "\\emph{ has footnote.}"
+ , "Big note in strong" =:
+ strong (str "This sentence"
+ <> note (para (str "paragraph1")
+ <> para (str "paragraph2"))
+ <> str " has footnote.")
+ =?>
+ "\\textbf{This sentence}\\footnote{paragraph1\n\n paragraph2}"
+ <> "\\textbf{ has footnote.}"
+
+ , "Big note in underline" =:
+ underline (str "This sentence"
+ <> note (para (str "paragraph1")
+ <> para (str "paragraph2"))
+ <> str " has footnote.")
+ =?>
+ "\\ul{This sentence}\\footnote{paragraph1\n\n paragraph2}"
+ <> "\\ul{ has footnote.}"
+
+ , "Big note in strikeout" =:
+ strikeout (str "This sentence"
+ <> note (para (str "paragraph1")
+ <> para (str "paragraph2"))
+ <> str " has footnote.")
+ =?>
+ "\\st{This sentence}\\footnote{paragraph1\n\n paragraph2}"
+ <> "\\st{ has footnote.}"
+
+ , "Small note in emph" =:
+ emph (str "This sentence"
+ <> note (para (str "paragraph"))
+ <> str " has footnote.")
+ =?>
+ "\\emph{This sentence\\footnote{paragraph} has footnote.}"
+
+ , "Big note nested in emph and strong" =:
+ emph (str "This "
+ <> strong (str "nested sentence "
+ <> note (para (str "paragraph1")
+ <> para (str "paragraph2"))
+ <> str "has ")
+ <> str "footnote."
+ )
+ =?>
+ "\\emph{This \\textbf{nested sentence }}\\footnote{paragraph1\n\n"
+ <> " paragraph2}\\emph{\\textbf{has }footnote.}"
+
+ , "Two Big notes in emph" =:
+ emph (str "This sentence"
+ <> note (para (str "1-paragraph1")
+ <> para (str "1-paragraph2"))
+ <> str " has"
+ <> note (para (str "2-paragraph1")
+ <> para (str "2-paragraph2"))
+ <> str " footnote.")
+ =?>
+ "\\emph{This sentence}\\footnote{1-paragraph1\n\n 1-paragraph2}"
+ <> "\\emph{ has}\\footnote{2-paragraph1\n\n 2-paragraph2}"
+ <> "\\emph{ footnote.}"
+ ]
, testGroup "writer options"
[ testGroup "top-level division" $
let