diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index c49b82ccf..1c13e597b 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -907,6 +907,7 @@ parseBlock (Elem e) = let classes' = case attrValue "language" e of "" -> [] x -> [x] + ++ ["numberLines" | attrValue "linenumbering" e == "numbered"] return $ codeBlockWith (attrValue "id" e, classes', []) $ trimNl $ strContentRecursive e parseBlockquote = do diff --git a/test/docbook-reader.docbook b/test/docbook-reader.docbook index f021dc8be..c38abda82 100644 --- a/test/docbook-reader.docbook +++ b/test/docbook-reader.docbook @@ -101,6 +101,11 @@ sub status { print "working"; } + + +sub status { + print "working with line numbers"; +} % ls diff --git a/test/docbook-reader.native b/test/docbook-reader.native index c8d59ca82..be3819336 100644 --- a/test/docbook-reader.native +++ b/test/docbook-reader.native @@ -266,6 +266,9 @@ Pandoc ] , CodeBlock ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , CodeBlock + ( "" , [ "numberLines" ] , [] ) + "sub status {\n print \"working with line numbers\";\n}" , CodeBlock ( "" , [] , [] ) "% ls" , Para [ Str "A" , Space , Str "list:" ] , OrderedList