Without `+styles`, consecutive "Source Code" paragraphs are combined into a single code block by `combineBlocks`. With `+styles`, each paragraph is first wrapped in a `Div` carrying its `custom-style` attribute, so the `CodeBlock` case no longer matched and every line became its own `Div [CodeBlock]`. Add a case that merges adjacent `Div [CodeBlock]` blocks when both the `Div` and the `CodeBlock` attributes are equal. Closes #9183.
277 B
277 B
Adjacent "Source Code" paragraphs become one code block with +styles,
as they do without it:
% pandoc -f docx+styles -t native command/9183.docx
^D
[ Div
( "" , [] , [ ( "custom-style" , "Source Code" ) ] )
[ CodeBlock ( "" , [] , [] ) "x = 1\ny = x + 1" ]
]