LaTeX reader: plainbreak, fancybreak et al from the memoir class (#3833)

This commit is contained in:
bucklereed 2017-08-05 18:03:31 +01:00 committed by John MacFarlane
parent 7a3a8790de
commit 685788cd4b
2 changed files with 35 additions and 0 deletions

View file

@ -1701,6 +1701,15 @@ blockCommands = M.fromList $
-- letters
, ("opening", (para . trimInlines) <$> (skipopts *> tok))
, ("closing", skipopts *> closing)
-- memoir
, ("plainbreak", braced >> pure horizontalRule)
, ("plainbreak*", braced >> pure horizontalRule)
, ("fancybreak", braced >> pure horizontalRule)
, ("fancybreak*", braced >> pure horizontalRule)
, ("plainfancybreak", braced >> braced >> braced >> pure horizontalRule)
, ("plainfancybreak*", braced >> braced >> braced >> pure horizontalRule)
, ("pfbreak", pure horizontalRule)
, ("pfbreak*", pure horizontalRule)
--
, ("hrule", pure horizontalRule)
, ("strut", pure mempty)

View file

@ -117,6 +117,32 @@ tests = [ testGroup "basic"
mconcat ["^^" <> T.pack [i] | i <- hex] =?>
para (str $ ['p'..'y']++['!'..'&'])
]
, testGroup "memoir scene breaks"
[ "plainbreak" =:
"hello\\plainbreak{2}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "plainbreak*" =:
"hello\\plainbreak*{2}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "fancybreak" =:
"hello\\fancybreak{b r e a k}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "fancybreak*" =:
"hello\\fancybreak*{b r e a k}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "plainfancybreak" =:
"hello\\plainfancybreak{4}{2}{b r e a k}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "plainfancybreak*" =:
"hello\\plainfancybreak*{4}{2}{b r e a k}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "pfbreak" =:
"hello\\pfbreak{}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
, "pfbreak*" =:
"hello\\pfbreak*{}goodbye" =?>
para (str "hello") <> horizontalRule <> para (str "goodbye")
]
]
baseCitation :: Citation