DocBook reader: honor linenumbering attribute
The attribute DocBook linenumbering="numbered" attribute on code blocks maps to "numberLines" internally.
This commit is contained in:
parent
ed8877bd68
commit
628cde48cf
3 changed files with 9 additions and 0 deletions
|
@ -907,6 +907,7 @@ parseBlock (Elem e) =
|
||||||
let classes' = case attrValue "language" e of
|
let classes' = case attrValue "language" e of
|
||||||
"" -> []
|
"" -> []
|
||||||
x -> [x]
|
x -> [x]
|
||||||
|
++ ["numberLines" | attrValue "linenumbering" e == "numbered"]
|
||||||
return $ codeBlockWith (attrValue "id" e, classes', [])
|
return $ codeBlockWith (attrValue "id" e, classes', [])
|
||||||
$ trimNl $ strContentRecursive e
|
$ trimNl $ strContentRecursive e
|
||||||
parseBlockquote = do
|
parseBlockquote = do
|
||||||
|
|
|
@ -101,6 +101,11 @@
|
||||||
sub status {
|
sub status {
|
||||||
print "working";
|
print "working";
|
||||||
}
|
}
|
||||||
|
</programlisting>
|
||||||
|
<programlisting linenumbering="numbered">
|
||||||
|
sub status {
|
||||||
|
print "working with line numbers";
|
||||||
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<screen>
|
<screen>
|
||||||
% <command>ls</command>
|
% <command>ls</command>
|
||||||
|
|
|
@ -266,6 +266,9 @@ Pandoc
|
||||||
]
|
]
|
||||||
, CodeBlock
|
, CodeBlock
|
||||||
( "" , [] , [] ) "sub status {\n print \"working\";\n}"
|
( "" , [] , [] ) "sub status {\n print \"working\";\n}"
|
||||||
|
, CodeBlock
|
||||||
|
( "" , [ "numberLines" ] , [] )
|
||||||
|
"sub status {\n print \"working with line numbers\";\n}"
|
||||||
, CodeBlock ( "" , [] , [] ) "% ls"
|
, CodeBlock ( "" , [] , [] ) "% ls"
|
||||||
, Para [ Str "A" , Space , Str "list:" ]
|
, Para [ Str "A" , Space , Str "list:" ]
|
||||||
, OrderedList
|
, OrderedList
|
||||||
|
|
Loading…
Add table
Reference in a new issue