From a41c1fe0bbdf912f3585c7eb91b59340c35b9b77 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 14 Oct 2021 16:16:25 +0200 Subject: asciidoc writer: translate numberLines attribute to linesnum switch AsciiDoctor allows to request line numbering on code blocks by using a switch on the `source` block, such as in: ``` [source%linesnum,haskell] ---- some Haskell code here ---- ``` --- test/Tests/Writers/AsciiDoc.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/Tests/Writers') diff --git a/test/Tests/Writers/AsciiDoc.hs b/test/Tests/Writers/AsciiDoc.hs index 04655635f..7b2dd11e8 100644 --- a/test/Tests/Writers/AsciiDoc.hs +++ b/test/Tests/Writers/AsciiDoc.hs @@ -38,6 +38,22 @@ tests = [ testGroup "emphasis" para (singleQuoted (strong (text "foo"))) =?> "`**foo**'" ] + , testGroup "blocks" + [ testAsciidoc "code block without line numbers" $ + codeBlockWith ("", [ "haskell" ], []) "foo" =?> unlines + [ "[source,haskell]" + , "----" + , "foo" + , "----" + ] + , testAsciidoc "code block with line numbers" $ + codeBlockWith ("", [ "haskell", "numberLines" ], []) "foo" =?> unlines + [ "[source%linesnum,haskell]" + , "----" + , "foo" + , "----" + ] + ] , testGroup "tables" [ testAsciidoc "empty cells" $ simpleTable [] [[mempty],[mempty]] =?> unlines -- cgit v1.2.3