From e75b729e633294aac0b8f117fe39d60f66818a1e Mon Sep 17 00:00:00 2001 From: Valgard Trontheim Date: Sat, 17 May 2025 16:35:43 +0200 Subject: [PATCH 1/6] feat(HTML): Preserve attributes on HTML paragraphs (#10768) - HTML reader wraps attributed `p` tags in `Div` with `wrapper="1"`. - HTML writer unwraps `Div` with `wrapper="1"` back to attributed `p` tag. - Add tests for HTML paragraph attribute roundtrip. - Update EPUB golden files to reflect new AST for attributed paragraphs. --- src/Text/Pandoc/Readers/HTML.hs | 36 +- src/Text/Pandoc/Writers/HTML.hs | 7 + test/Tests/Readers/HTML.hs | 20 + test/Tests/Writers/HTML.hs | 26 + test/epub/features.native | 1658 ++++----- test/epub/formatting.native | 5606 ++++++++++++++++--------------- 6 files changed, 3913 insertions(+), 3440 deletions(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index fcc1147ca376..c9c6e0f20cd9 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -625,11 +625,37 @@ pPlain = do pPara :: PandocMonad m => TagParser m Blocks pPara = do - contents <- trimInlines <$> pInTags "p" inline - (do guardDisabled Ext_empty_paragraphs - guard (null contents) - return mempty) - <|> return (B.para contents) + TagOpen _ attr' <- lookAhead $ pSatisfy (matchTagOpen "p" []) + let (ident, classes, kvs) = toAttr attr' + let alignValue = lookup "align" kvs + -- "Significant" attributes are any id, class, or key-value pair other than 'align'. + let significantKVs = filter (\(k,_) -> k /= "align") kvs + let hasSignificantAttributes = not (T.null ident) || not (null classes) || not (null significantKVs) + + if hasSignificantAttributes + then do + -- If there are significant attributes, parse as Div with wrapper="1" + -- All original attributes (including align, if present) go on this Div. + guardEnabled Ext_native_divs -- Ensure native_divs is enabled for this behavior + pInhalt <- trimInlines <$> pInTags "p" inline + (do guardDisabled Ext_empty_paragraphs + guard (null pInhalt) + return mempty) <|> do + let wrapperAttr = ("wrapper", "1") + -- Use all original kvs for the Div + let finalAttrs = (ident, classes, wrapperAttr : kvs) + return $ B.divWith finalAttrs (B.para pInhalt) + else do + -- If only 'align' (or no attributes) is present, handle as before. + contents <- trimInlines <$> pInTags "p" inline + let paraBlock = B.para contents + (do guardDisabled Ext_empty_paragraphs + guard (null contents) + return mempty) <|> + return (case alignValue of + Just algn | algn `elem` ["left","right","center","justify"] -> + B.divWith ("", [], [("align", algn)]) paraBlock + _ -> paraBlock) pFigure :: PandocMonad m => TagParser m Blocks pFigure = do diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index bb54f0f82e10..bf02a301ab70 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -750,6 +750,13 @@ blockToHtmlInner opts (Para lst) = do blockToHtmlInner opts (LineBlock lns) = do htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns return $ H.div ! A.class_ "line-block" $ htmlLines +blockToHtmlInner opts (Div (ident, classes, kvs) [Para pans]) | Just "1" <- lookup "wrapper" kvs = do + -- This is a paragraph that was wrapped in a Div by the reader + -- Unwrap it back to a

tag, transferring attributes from the Div + let pKVs = filter (\(k,_) -> k /= "wrapper") kvs + let pAttr = (ident, classes, pKVs) + inner <- inlineListToHtml opts pans + addAttrs opts pAttr (H.p inner) blockToHtmlInner opts (Div (ident, "section":dclasses, dkvs) (Header level hattr@(hident,hclasses,hkvs) ils : xs)) = do diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 5b7ab12fd3fa..6e07d152fb5b 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -137,6 +137,26 @@ tests = [ testGroup "base tag" =?> codeBlockWith ("c", [], []) "print('hi mom!')" ] + , testGroup "paragraph attributes" + [ test htmlNativeDivs "paragraph with id and class" $ + "

This is a paragraph.

" =?> + doc (divWith ("mypara", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph."))) + , test htmlNativeDivs "paragraph with id only" $ + "

This is a paragraph.

" =?> + doc (divWith ("mypara", [], [("wrapper", "1")]) (para (text "This is a paragraph."))) + , test htmlNativeDivs "paragraph with class only" $ + "

This is a paragraph.

" =?> + doc (divWith ("", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph."))) + , test htmlNativeDivs "paragraph with multiple classes" $ + "

This is a paragraph.

" =?> + doc (divWith ("", ["important", "urgent"], [("wrapper", "1")]) (para (text "This is a paragraph."))) + , test htmlNativeDivs "paragraph with key-value attributes" $ + "

This is a paragraph.

" =?> + doc (divWith ("", [], [("wrapper", "1"), ("foo", "bar")]) (para (text "This is a paragraph."))) + , test htmlNativeDivs "paragraph without attributes" $ + "

This is a normal paragraph.

" =?> + doc (para (text "This is a normal paragraph.")) + ] , askOption $ \(QuickCheckTests numtests) -> testProperty "Round trip" $ withMaxSuccess (if QuickCheckTests numtests == defaultValue diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index ea313b862ea7..7c1d7db5662e 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -21,6 +21,9 @@ htmlQTags = unpack . purely (writeHtml4String def{ writerWrapText = WrapNone, writerHtmlQTags = True }) . toPandoc +html5 :: (ToPandoc a) => a -> String +html5 = unpack . purely (writeHtml5String def{ writerWrapText = WrapNone }) . toPandoc + {- "my test" =: X =?> Y @@ -208,6 +211,29 @@ tests = , "" ] ] + , testGroup "paragraph attributes" + [ "paragraph with id and class" =: + divWith ("mypara", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + =?> "

This is a paragraph.

" + , "paragraph with id only" =: + divWith ("mypara", [], [("wrapper", "1")]) (para (text "This is a paragraph.")) + =?> "

This is a paragraph.

" + , "paragraph with class only" =: + divWith ("", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + =?> "

This is a paragraph.

" + , "paragraph with multiple classes" =: + divWith ("", ["important", "urgent"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + =?> "

This is a paragraph.

" + , test html5 "paragraph with key-value attributes" + (divWith ("", [], [("wrapper", "1"), ("foo", "bar")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) + , "paragraph without wrapper attribute" =: + divWith ("mydiv", ["someclass"], []) (para (text "This is a div, not a p.")) + =?> "
\n

This is a div, not a p.

\n
" + , "paragraph with wrapper and other attributes" =: + divWith ("mypara", ["important"], [("wrapper", "1"), ("data-value", "123")]) (para (text "This is a paragraph.")) + =?> "

This is a paragraph.

" + ] ] where tQ :: (ToString a, ToPandoc a) diff --git a/test/epub/features.native b/test/epub/features.native index 761e035868ef..6461c4bda118 100644 --- a/test/epub/features.native +++ b/test/epub/features.native @@ -613,20 +613,23 @@ Pandoc , Space , Str "Rendering" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "MathML" - , Space - , Str "equation" - , Space - , Str "rendering" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "MathML" + , Space + , Str "equation" + , Space + , Str "rendering" + , Space + , Str "is" + , Space + , Str "supported." + ] ] , Plain [ Math @@ -641,36 +644,39 @@ Pandoc DisplayMath "x = \\frac{- b \\pm \\sqrt{b^{2} - 4ac}}{2a}" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "equations" - , Space - , Str "are" - , Space - , Str "not" - , Space - , Str "presented" - , Space - , Str "as" - , Space - , Str "linear" - , Space - , Str "text" - , Space - , Str "(e.g.," - , Space - , Str "x=-b\177b2-4ac2a)," - , SoftBreak - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "equations" + , Space + , Str "are" + , Space + , Str "not" + , Space + , Str "presented" + , Space + , Str "as" + , Space + , Str "linear" + , Space + , Str "text" + , Space + , Str "(e.g.," + , Space + , Str "x=-b\177b2-4ac2a)," + , SoftBreak + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -697,106 +703,115 @@ Pandoc , Space , Str "element" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "math" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "math" + , Space + , Str "element." + ] ] , Plain [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "equation" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "yellow" - , Space - , Str "background" - , Space - , Str "and" - , Space - , Str "a" - , Space - , Str "dashed" - , Space - , Str "border." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "equation" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "yellow" + , Space + , Str "background" + , Space + , Str "and" + , Space + , Str "a" + , Space + , Str "dashed" + , Space + , Str "border." + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code ( "" , [] , [] ) "Not Supported" - , Str "." + , Div + ( "" , [ "conditional" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] ] ] , Div @@ -823,108 +838,117 @@ Pandoc , Space , Str "element" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "mo" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mo" + , Space + , Str "element." + ] ] , Plain [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "operators" - , Space - , Str "are" - , Space - , Str "enlarged" - , Space - , Str "relative" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "other" - , Space - , Str "symbols" - , Space - , Str "and" - , Space - , Str "numbers." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "operators" + , Space + , Str "are" + , Space + , Str "enlarged" + , Space + , Str "relative" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Str "other" + , Space + , Str "symbols" + , Space + , Str "and" + , Space + , Str "numbers." + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code ( "" , [] , [] ) "Not Supported" - , Str "." + , Div + ( "" , [ "conditional" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] ] ] , Div @@ -951,218 +975,236 @@ Pandoc , Space , Str "element" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "mi" - , Space - , Str "element." - ] - , Plain [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "identifiers" - , Space - , Str "are" - , Space - , Str "bolded" - , Space - , Str "and" - , Space - , Str "blue." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code ( "" , [] , [] ) "Not Supported" - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml_mathml-023" - , [ "section" , "otest" ] - , [] - ) - [ Header - 2 - ( "" , [] , [] ) - [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] - , SoftBreak - , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-023" ] - , Space - , Str "CSS" - , Space - , Str "Styling" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "mn" - , Space - , Str "element" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "mn" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mi" + , Space + , Str "element." + ] ] , Plain [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "number" - , Space - , Str "2" - , Space - , Str "is" - , Space - , Str "italicized" - , Space - , Str "and" - , Space - , Str "blue." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "identifiers" + , Space + , Str "are" + , Space + , Str "bolded" + , Space + , Str "and" + , Space + , Str "blue." + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" + , Div + ( "" , [ "conditional" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] + ] + ] + , Div + ( "content-mathml-001.xhtml_mathml-023" + , [ "section" , "otest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] , SoftBreak - , Str "CSS" - , Space - , Str "styles," + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-023" ] , Space - , Str "this" + , Str "CSS" , Space - , Str "test" + , Str "Styling" , Space - , Str "should" + , Str "of" , Space - , Str "be" + , Str "the" , Space - , Str "marked" + , Code ( "" , [] , [] ) "mn" , Space - , Code ( "" , [] , [] ) "Not Supported" - , Str "." + , Str "element" + ] + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mn" + , Space + , Str "element." + ] + ] + , Plain [ Math InlineMath "{2x}{+ y - z}" ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "number" + , Space + , Str "2" + , Space + , Str "is" + , Space + , Str "italicized" + , Space + , Str "and" + , Space + , Str "blue." + ] + ] + , Div + ( "" , [ "conditional" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] ] ] , Div @@ -1192,52 +1234,58 @@ Pandoc , Space , Str "elements" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "horizontal" - , Space - , Str "stretch," - , Space - , Code ( "" , [] , [] ) "mover" - , Str "," - , Space - , Code ( "" , [] , [] ) "munder" - , Str "," - , Space - , Code ( "" , [] , [] ) "mspace" - , Space - , Str "elements" - , Space - , Str "are" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "horizontal" + , Space + , Str "stretch," + , Space + , Code ( "" , [] , [] ) "mover" + , Str "," + , Space + , Code ( "" , [] , [] ) "munder" + , Str "," + , Space + , Code ( "" , [] , [] ) "mspace" + , Space + , Str "elements" + , Space + , Str "are" + , Space + , Str "supported." + ] ] , Plain [ Math DisplayMath "c = \\overset{\\text{complex number}}{\\overbrace{\\underset{\\text{real}}{\\underbrace{\\mspace{20mu} a\\mspace{20mu}}} + \\underset{\\text{imaginary}}{\\underbrace{\\quad b{\\mathbb{i}}\\quad}}}}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "." + ] ] ] , Div @@ -1273,76 +1321,82 @@ Pandoc , Space , Str "fonts" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Code ( "" , [] , [] ) "mtable" - , Space - , Str "with" - , Space - , Code ( "" , [] , [] ) "colspan" - , Space - , Str "and" - , Space - , Code ( "" , [] , [] ) "mspace" - , Space - , Str "attributes" - , Space - , Str "(column" - , Space - , Str "and" - , Space - , Str "row" - , Space - , Str "spanning)" - , Space - , Str "are" - , Space - , Str "supported;" - , Space - , Str "uses" - , Space - , Str "Hebrew" - , Space - , Str "and" - , Space - , Str "Script" - , Space - , Str "alphabets." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Code ( "" , [] , [] ) "mtable" + , Space + , Str "with" + , Space + , Code ( "" , [] , [] ) "colspan" + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "mspace" + , Space + , Str "attributes" + , Space + , Str "(column" + , Space + , Str "and" + , Space + , Str "row" + , Space + , Str "spanning)" + , Space + , Str "are" + , Space + , Str "supported;" + , Space + , Str "uses" + , Space + , Str "Hebrew" + , Space + , Str "and" + , Space + , Str "Script" + , Space + , Str "alphabets." + ] ] , Plain [ Math DisplayMath "\\begin{matrix}\n & {\\operatorname{cov}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{L})} & \\longrightarrow & 2^{\\aleph_{0}} \\\\\n & \\uparrow & & \\uparrow & & \\uparrow & & \\uparrow & & \\\\\n & {\\mathfrak{b}} & \\longrightarrow & {\\mathfrak{d}} & & & & & & \\\\\n & \\uparrow & & \\uparrow & & & & & & \\\\\n\\aleph_{1} & \\longrightarrow & {\\operatorname{add}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{add}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cov}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{L})} & \n\\end{matrix}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Link - ( "" , [] , [] ) - [ Str "Cicho\324's" , Space , Str "Diagram" ] - ( "http://en.wikipedia.org/wiki/Cicho%C5%84's_diagram" - , "" - ) - , Str ":" - , Space - , Str "." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Link + ( "" , [] , [] ) + [ Str "Cicho\324's" , Space , Str "Diagram" ] + ( "http://en.wikipedia.org/wiki/Cicho%C5%84's_diagram" + , "" + ) + , Str ":" + , Space + , Str "." + ] ] ] , Div @@ -1366,50 +1420,56 @@ Pandoc , Space , Str "alphabets" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "right-to-left" - , Space - , Str "and" - , Space - , Str "Arabic" - , Space - , Str "alphabets" - , Space - , Str "are" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "right-to-left" + , Space + , Str "and" + , Space + , Str "Arabic" + , Space + , Str "alphabets" + , Space + , Str "are" + , Space + , Str "supported." + ] ] , Plain [ Math DisplayMath "{\1583(\1587)} = \\left\\{ \\begin{matrix}\n{\\sum\\limits_{\1646 = 1}^{\1589}\1587^{\1646}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 > 0} \\\\\n{\\int_{1}^{\1589}{\1587^{\1646}\1569\1587}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 \\in \1605} \\\\\n{{\1591\1575}\\pi} & {\\text{\1594\1610\1585\1584\1604\1603}\\left( \\text{\1605\1593}\\pi \\simeq 3,141 \\right)}\n\\end{matrix} \\right." ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "the" - , Space - , Str "following" - , Space - , Str "image:" + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "the" + , Space + , Str "following" + , Space + , Str "image:" + ] ] ] , Div @@ -1433,24 +1493,27 @@ Pandoc , Space , Str "notation" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Code ( "" , [] , [] ) "mlongdiv" - , Space - , Str "elements" - , Space - , Str "(from" - , Space - , Str "elementary" - , Space - , Str "math)" - , Space - , Str "are" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Code ( "" , [] , [] ) "mlongdiv" + , Space + , Str "elements" + , Space + , Str "(from" + , Space + , Str "elementary" + , Space + , Str "math)" + , Space + , Str "are" + , Space + , Str "supported." + ] ] , Plain [ Span @@ -1484,30 +1547,33 @@ Pandoc , SoftBreak ] ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "the" - , Space - , Str "following" - , Space - , Str "image:" - , Space - , Str "." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "the" + , Space + , Str "following" + , Space + , Str "image:" + , Space + , Str "." + ] ] ] ] @@ -1533,87 +1599,98 @@ Pandoc , Space , Str "Support" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Link - ( "" , [] , [] ) - [ Code ( "" , [] , [] ) "epub:switch" ] - ( "http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-content-switch" - , "" - ) - , Space - , Str "element" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Link + ( "" , [] , [] ) + [ Code ( "" , [] , [] ) "epub:switch" ] + ( "http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-content-switch" + , "" + ) + , Space + , Str "element" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "PASS" ] - , Para - [ Str "If" - , Space - , Str "only" - , Space - , Str "the" - , Space - , Str "word" - , Space - , Str "\"PASS\"" - , Space - , Str "is" - , Space - , Str "rendered" - , Space - , Str "before" - , Space - , Str "this" - , Space - , Str "paragraph," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - , Space - , Str "If" - , Space - , Str "both" - , Space - , Str "\"PASS\"" - , Space - , Str "and" - , Space - , Str "\"FAIL\"" - , Space - , Str "are" - , Space - , Str "rendered," - , Space - , Str "or" - , Space - , Str "neither" - , SoftBreak - , Str "\"PASS\"" - , Space - , Str "nor" - , Space - , Str "\"FAIL\"" - , Space - , Str "is" - , Space - , Str "rendered," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "content-switch-001.xhtml_fallback" + , [] + , [ ( "wrapper" , "1" ) ] + ) + [ Para [ Str "PASS" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "only" + , Space + , Str "the" + , Space + , Str "word" + , Space + , Str "\"PASS\"" + , Space + , Str "is" + , Space + , Str "rendered" + , Space + , Str "before" + , Space + , Str "this" + , Space + , Str "paragraph," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + , Space + , Str "If" + , Space + , Str "both" + , Space + , Str "\"PASS\"" + , Space + , Str "and" + , Space + , Str "\"FAIL\"" + , Space + , Str "are" + , Space + , Str "rendered," + , Space + , Str "or" + , Space + , Str "neither" + , SoftBreak + , Str "\"PASS\"" + , Space + , Str "nor" + , Space + , Str "\"FAIL\"" + , Space + , Str "is" + , Space + , Str "rendered," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div @@ -1632,89 +1709,98 @@ Pandoc , Space , Str "Embedding" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Str "MathML" - , Space - , Str "namespace" - , Space - , Str "is" - , Space - , Str "recognized" - , Space - , Str "when" - , Space - , Str "used" - , Space - , Str "in" - , Space - , Str "an" - , Space - , Link - ( "" , [] , [] ) - [ Code ( "" , [] , [] ) "epub:case" ] - ( "http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-epub-case" - , "" - ) - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Str "MathML" + , Space + , Str "namespace" + , Space + , Str "is" + , Space + , Str "recognized" + , Space + , Str "when" + , Space + , Str "used" + , Space + , Str "in" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Code ( "" , [] , [] ) "epub:case" ] + ( "http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-epub-case" + , "" + ) + , Space + , Str "element." + ] ] , Para [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "If" - , Space - , Str "a" - , Space - , Str "MathML" - , Space - , Str "equation" - , Space - , Str "is" - , Space - , Str "rendered" - , Space - , Str "before" - , Space - , Str "this" - , Space - , Str "paragraph," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "a" + , Space + , Str "MathML" + , Space + , Str "equation" + , Space + , Str "is" + , Space + , Str "rendered" + , Space + , Str "before" + , Space + , Str "this" + , Space + , Str "paragraph," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] - , Para - [ Str "If" - , Space - , Str "test" - , Space - , Code ( "" , [] , [] ) "switch-010" - , Space - , Str "did" - , Space - , Str "not" - , Space - , Str "pass," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code ( "" , [] , [] ) "Not Supported" - , Str "." + , Div + ( "" , [ "conditional" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "test" + , Space + , Code ( "" , [] , [] ) "switch-010" + , Space + , Str "did" + , Space + , Str "not" + , Space + , Str "pass," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] ] ] ] diff --git a/test/epub/formatting.native b/test/epub/formatting.native index cc2b4f649764..86acce137090 100644 --- a/test/epub/formatting.native +++ b/test/epub/formatting.native @@ -626,25 +626,28 @@ Pandoc , Space , Str "Layouts" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Link - ( "" , [] , [] ) - [ Code ( "" , [] , [] ) "CSS Multi-Column Layout" ] - ( "http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-css-multi-column" - , "" - ) - , Space - , Str "properties" - , Space - , Str "are" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Link + ( "" , [] , [] ) + [ Code ( "" , [] , [] ) "CSS Multi-Column Layout" ] + ( "http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-css-multi-column" + , "" + ) + , Space + , Str "properties" + , Space + , Str "are" + , Space + , Str "supported." + ] ] , Div ( "" , [ "multicol" ] , [] ) @@ -1900,30 +1903,33 @@ Pandoc , Str "laborum." ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "rendered" - , Space - , Str "in" - , Space - , Str "three" - , Space - , Str "columns," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "rendered" + , Space + , Str "in" + , Space + , Str "three" + , Space + , Str "columns," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Para [ Span ( "styling-xhtml-002.xhtml" , [] , [] ) [] ] @@ -1961,34 +1967,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "decimal" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "decimal" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "decimal" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -1998,32 +2007,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "decimal" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "decimal" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2040,34 +2052,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "circle" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "circle" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ul" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "circle" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] ] , BulletList [ [ Plain [ Str "Lorem" ] ] @@ -2076,26 +2091,29 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "circle" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "circle" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2112,34 +2130,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "square" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "square" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ul" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "square" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] ] , BulletList [ [ Plain [ Str "Lorem" ] ] @@ -2148,26 +2169,29 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "square" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "square" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2184,34 +2208,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "disc" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "disc" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ul" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "disc" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] ] , BulletList [ [ Plain [ Str "Lorem" ] ] @@ -2220,26 +2247,29 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "disc" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "disc" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2256,34 +2286,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "lower-latin" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "lower-latin" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-latin" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2293,32 +2326,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-latin" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-latin" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2335,34 +2371,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "lower-roman" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "lower-roman" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-roman" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2372,32 +2411,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-roman" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-roman" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2414,34 +2456,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "upper-alpha" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "upper-alpha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "upper-alpha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2451,32 +2496,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "upper-alpha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "upper-alpha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2493,34 +2541,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "hiragana" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "hiragana" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "hiragana" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2530,32 +2581,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "hiragana" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "hiragana" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2572,34 +2626,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "hiragana-iroha" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "hiragana-iroha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "hiragana-iroha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2609,32 +2666,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "hiragana-iroha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "hiragana-iroha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2651,34 +2711,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "katakana" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "katakana" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "katakana" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2688,32 +2751,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "katakana" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "katakana" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2730,34 +2796,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "katakana-iroha" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "katakana-iroha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "katakana-iroha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2767,32 +2836,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "katakana-iroha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "katakana-iroha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2809,34 +2881,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "upper-roman" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "upper-roman" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "upper-roman" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2846,32 +2921,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "upper-roman" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "upper-roman" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2888,34 +2966,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "upper-latin" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "upper-latin" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "upper-latin" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -2925,32 +3006,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "upper-latin" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "upper-latin" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -2967,34 +3051,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "lower-alpha" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "lower-alpha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-alpha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3004,32 +3091,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-alpha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-alpha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3046,34 +3136,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "lower-greek" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "lower-greek" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-greek" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3083,32 +3176,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-greek" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-greek" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3125,34 +3221,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "armenian" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "armenian" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "armenian" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3162,32 +3261,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "armenian" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "armenian" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3204,34 +3306,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "cjk-ideographic" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "cjk-ideographic" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "cjk-ideographic" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3241,32 +3346,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "cjk-ideographic" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "cjk-ideographic" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3283,34 +3391,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "decimal-leading-zero" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "decimal-leading-zero" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "decimal-leading-zero" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3320,32 +3431,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "decimal-leading-zero" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "decimal-leading-zero" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3362,34 +3476,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "georgian" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "georgian" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "georgian" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3399,32 +3516,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "georgian" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "georgian" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3441,34 +3561,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "hebrew" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "hebrew" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "hebrew" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3478,32 +3601,35 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "hebrew" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "hebrew" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -3520,34 +3646,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "none" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "none" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "none" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] ] , OrderedList ( 1 , DefaultStyle , DefaultDelim ) @@ -3557,26 +3686,29 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "no" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "no" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] ] @@ -3608,36 +3740,39 @@ Pandoc , Space , Str "images" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style" - , Space - , Str "shorthand" - , Space - , Str "property" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "using" - , Space - , Str "a" - , Space - , Str "gif" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ul" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style" + , Space + , Str "shorthand" + , Space + , Str "property" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "using" + , Space + , Str "a" + , Space + , Str "gif" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] ] , BulletList [ [ Plain [ Str "Lorem" ] ] @@ -3646,34 +3781,37 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "the" - , Space - , Str "purple" - , Space - , Str "and" - , Space - , Str "aqua" - , Space - , Str "square" - , Space - , Str "bullet" - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "the" + , Space + , Str "purple" + , Space + , Str "and" + , Space + , Str "aqua" + , Space + , Str "square" + , Space + , Str "bullet" + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] ] @@ -3711,34 +3849,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "inside" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "inside" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ul" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "inside" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] ] , BulletList [ [ Plain @@ -3964,30 +4105,33 @@ Pandoc ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "markers" - , Space - , Str "inside" - , Space - , Str "the" - , Space - , Str "indentation," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "markers" + , Space + , Str "inside" + , Space + , Str "the" + , Space + , Str "indentation," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -4010,34 +4154,37 @@ Pandoc , Space , Code ( "" , [] , [] ) "outside" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "list-style-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "outside" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ul" - , Space - , Str "element." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "outside" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] ] , BulletList [ [ Plain @@ -4263,36 +4410,39 @@ Pandoc ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "the" - , Space - , Str "default" - , Space - , Str "setting" - , Space - , Str "(marker" - , Space - , Str "outside" - , Space - , Str "the" - , Space - , Str "indentation)," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "the" + , Space + , Str "default" + , Space + , Str "setting" + , Space + , Str "(marker" + , Space + , Str "outside" + , Space + , Str "the" + , Space + , Str "indentation)," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] ] @@ -4330,36 +4480,39 @@ Pandoc , Space , Str "set" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "start" - , Space - , Str "attribute" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element" - , Space - , Str "with" - , Space - , Str "no" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "start" + , Space + , Str "attribute" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property." + ] ] , OrderedList ( 25 , DefaultStyle , DefaultDelim ) @@ -4369,26 +4522,29 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "starts" - , Space - , Str "at" - , Space - , Str "25," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "starts" + , Space + , Str "at" + , Space + , Str "25," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -4409,36 +4565,39 @@ Pandoc , Space , Str "set" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "start" - , Space - , Str "attribute" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "ol" - , Space - , Str "element" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Code ( "" , [] , [] ) "list-style-type" - , Space - , Str "property." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "start" + , Space + , Str "attribute" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property." + ] ] , OrderedList ( 50 , DefaultStyle , DefaultDelim ) @@ -4448,28 +4607,31 @@ Pandoc , [ Plain [ Str "Sit" ] ] , [ Plain [ Str "Amet" ] ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "starts" - , Space - , Str "at" - , Space - , Str "'L'" - , Space - , Str "(50)," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "starts" + , Space + , Str "at" + , Space + , Str "'L'" + , Space + , Str "(50)," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] ] @@ -4498,46 +4660,54 @@ Pandoc , Space , Code ( "" , [] , [] ) "all" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "all" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "all" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" , [ "media-all" ] , [ ( "wrapper" , "1" ) ] ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div @@ -4554,50 +4724,122 @@ Pandoc , Space , Code ( "" , [] , [] ) "screen" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "screen" + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "screen" + , Space + , Str "is" + , Space + , Str "supported." + ] + ] + , Div + ( "" , [ "media-screen" ] , [ ( "wrapper" , "1" ) ] ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] + ] + ] + , Div + ( "styling-xhtml-004.xhtml_style-212" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Str "is" + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-212" ] , Space - , Str "supported." + , Code ( "" , [] , [] ) "handheld" ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "handheld" + , Space + , Str "is" + , Space + , Str "supported." + ] + ] + , Div + ( "" , [ "media-handheld" ] , [ ( "wrapper" , "1" ) ] ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div - ( "styling-xhtml-004.xhtml_style-212" + ( "styling-xhtml-004.xhtml_style-213" , [ "section" , "ctest" ] , [] ) @@ -4606,54 +4848,62 @@ Pandoc ( "" , [] , [] ) [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Span ( "" , [ "test-id" ] , [] ) [ Str "style-212" ] + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-213" ] , Space - , Code ( "" , [] , [] ) "handheld" + , Code ( "" , [] , [] ) "tv" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "handheld" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "tv" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" , [ "media-tv" ] , [ ( "wrapper" , "1" ) ] ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div - ( "styling-xhtml-004.xhtml_style-213" + ( "styling-xhtml-004.xhtml_style-220" , [ "section" , "ctest" ] , [] ) @@ -4662,54 +4912,93 @@ Pandoc ( "" , [] , [] ) [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Span ( "" , [ "test-id" ] , [] ) [ Str "style-213" ] + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-220" ] , Space - , Code ( "" , [] , [] ) "tv" + , Code ( "" , [] , [] ) "orientation:landscape" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "tv" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "orientation:landscape" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" + , [ "orientation-landscape" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"" + , Space + , Str "when" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "is" + , Space + , Str "held" + , Space + , Str "in" + , Space + , Str "landscape" + , Space + , Str "mode," + , Space + , Str "and" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "supports" + , Space + , Str "multiple" + , Space + , Str "orientations," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div - ( "styling-xhtml-004.xhtml_style-220" + ( "styling-xhtml-004.xhtml_style-221" , [ "section" , "ctest" ] , [] ) @@ -4718,162 +5007,89 @@ Pandoc ( "" , [] , [] ) [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Span ( "" , [ "test-id" ] , [] ) [ Str "style-220" ] + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-221" ] , Space - , Code ( "" , [] , [] ) "orientation:landscape" + , Code ( "" , [] , [] ) "orientation:portrait" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "orientation:landscape" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "orientation:portrait" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"" - , Space - , Str "when" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "is" - , Space - , Str "held" - , Space - , Str "in" - , Space - , Str "landscape" - , Space - , Str "mode," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "supports" - , Space - , Str "multiple" - , Space - , Str "orientations," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml_style-221" - , [ "section" , "ctest" ] - , [] - ) - [ Header - 3 - ( "" , [] , [] ) - [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] - , Space - , Span ( "" , [ "test-id" ] , [] ) [ Str "style-221" ] - , Space - , Code ( "" , [] , [] ) "orientation:portrait" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "orientation:portrait" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"" - , Space - , Str "when" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "is" - , Space - , Str "held" - , Space - , Str "in" - , Space - , Str "portrait" - , Space - , Str "mode," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "supports" - , Space - , Str "multiple" - , Space - , Str "orientations," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" + , [ "orientation-portrait" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"" + , Space + , Str "when" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "is" + , Space + , Str "held" + , Space + , Str "in" + , Space + , Str "portrait" + , Space + , Str "mode," + , Space + , Str "and" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "supports" + , Space + , Str "multiple" + , Space + , Str "orientations," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div @@ -4890,46 +5106,54 @@ Pandoc , Space , Code ( "" , [] , [] ) "min-width" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "min-width:200px" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "min-width:200px" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" , [ "min-width-200" ] , [ ( "wrapper" , "1" ) ] ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div @@ -4946,46 +5170,54 @@ Pandoc , Space , Code ( "" , [] , [] ) "max-width" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "max-width:2000px" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "max-width:2000px" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" , [ "max-width-2000" ] , [ ( "wrapper" , "1" ) ] ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div @@ -5002,46 +5234,57 @@ Pandoc , Space , Code ( "" , [] , [] ) "min-device-width" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "min-device-width:200px" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "min-device-width:200px" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" + , [ "min-device-width-200" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] , Div @@ -5058,46 +5301,57 @@ Pandoc , Space , Code ( "" , [] , [] ) "max-device-width" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code ( "" , [] , [] ) "max-device-width:2000px" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "max-device-width:2000px" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." + , Div + ( "" + , [ "max-device-width-2000" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para [ Str "FAIL" ] ] + , Div + ( "" , [ "eval" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] ] ] @@ -5130,598 +5384,634 @@ Pandoc , Space , Code ( "" , [] , [] ) "uppercase" ] - , Para - [ Str "Tests" + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "text-transform" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "uppercase" + , Space + , Str "is" + , Space + , Str "supported." + ] + ] + , Div + ( "" + , [ "transform-uppercase" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + ] + , Div + ( "" , [ "fallback" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "upper" + , Space + , Str "case," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + ] + , Div + ( "styling-xhtml-005.xhtml_style-311" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "text-transform" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "uppercase" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "upper" - , Space - , Str "case," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-005.xhtml_style-311" - , [ "section" , "ctest" ] - , [] - ) - [ Header - 2 - ( "" , [] , [] ) - [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] - , Space - , Span ( "" , [ "test-id" ] , [] ) [ Str "style-311" ] + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-311" ] , Space , Code ( "" , [] , [] ) "capitalize" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "text-transform" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "capitalize" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "text-transform" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "capitalize" + , Space + , Str "is" + , Space + , Str "supported." + ] ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "If" - , Space - , Str "each" - , Space - , Str "first" - , Space - , Str "letter" - , Space - , Str "of" - , Space - , Str "each" - , Space - , Str "word" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "upper" - , Space - , Str "case," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-005.xhtml_style-312" - , [ "section" , "ctest" ] - , [] - ) - [ Header - 2 - ( "" , [] , [] ) - [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] - , Space - , Span ( "" , [ "test-id" ] , [] ) [ Str "style-312" ] - , Space - , Code ( "" , [] , [] ) "lowercase" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "text-transform" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "lowercase" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." + , Div + ( "" + , [ "transform-capitalize" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "lower" - , Space - , Str "case," - , Space - , Str "the" + , Div + ( "" , [ "fallback" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "each" + , Space + , Str "first" + , Space + , Str "letter" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "word" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "upper" + , Space + , Str "case," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + ] + , Div + ( "styling-xhtml-005.xhtml_style-312" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Str "test" + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-312" ] , Space - , Str "passes." + , Code ( "" , [] , [] ) "lowercase" + ] + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "text-transform" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "lowercase" + , Space + , Str "is" + , Space + , Str "supported." + ] + ] + , Div + ( "" + , [ "transform-lowercase" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + ] + , Div + ( "" , [ "fallback" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "lower" + , Space + , Str "case," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] ] @@ -5754,26 +6044,29 @@ Pandoc , Space , Code ( "" , [] , [] ) "over" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "-epub-ruby-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "over" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "-epub-ruby-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "over" + , Space + , Str "is" + , Space + , Str "supported." + ] ] , Plain [ RawInline (Format "html") "" @@ -5792,45 +6085,48 @@ Pandoc , RawInline (Format "html") "" , RawInline (Format "html") "" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "Ruby" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "positioned" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Link - ( "" , [] , [] ) - [ Str "over" ] - ( "http://www.w3.org/TR/css3-writing-modes/#over" - , "" - ) - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "ruby" - , Space - , Str "base," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "fallback" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "Ruby" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "positioned" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Link + ( "" , [] , [] ) + [ Str "over" ] + ( "http://www.w3.org/TR/css3-writing-modes/#over" + , "" + ) + , Space + , Str "side" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "ruby" + , Space + , Str "base," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -5847,26 +6143,29 @@ Pandoc , Space , Code ( "" , [] , [] ) "under" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "-epub-ruby-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "under" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "-epub-ruby-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "under" + , Space + , Str "is" + , Space + , Str "supported." + ] ] , Plain [ RawInline (Format "html") "" @@ -5885,45 +6184,48 @@ Pandoc , RawInline (Format "html") "" , RawInline (Format "html") "" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "Ruby" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "positioned" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Link - ( "" , [] , [] ) - [ Str "under" ] - ( "http://www.w3.org/TR/css3-writing-modes/#under" - , "" - ) - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "ruby" - , Space - , Str "base," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "fallback" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "Ruby" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "positioned" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Link + ( "" , [] , [] ) + [ Str "under" ] + ( "http://www.w3.org/TR/css3-writing-modes/#under" + , "" + ) + , Space + , Str "side" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "ruby" + , Space + , Str "base," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] , Div @@ -5940,26 +6242,29 @@ Pandoc , Space , Code ( "" , [] , [] ) "inter-character" ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code ( "" , [] , [] ) "-epub-ruby-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "inter-caracter" - , Space - , Str "is" - , Space - , Str "supported." + , Div + ( "" , [ "desc" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "-epub-ruby-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "inter-caracter" + , Space + , Str "is" + , Space + , Str "supported." + ] ] , Plain [ RawInline @@ -5980,40 +6285,43 @@ Pandoc , RawInline (Format "html") "" , RawInline (Format "html") "" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "Ruby" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "positioned" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "right" - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "base" - , Space - , Str "text," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "" , [ "fallback" ] , [ ( "wrapper" , "1" ) ] ) + [ Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "Ruby" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "positioned" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "right" + , Space + , Str "side" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "base" + , Space + , Str "text," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] ] ] ] From ec0c62bb912efa8492d3b62f9c595c05f240631a Mon Sep 17 00:00:00 2001 From: Valgard Trontheim Date: Sat, 17 May 2025 17:16:08 +0200 Subject: [PATCH 2/6] refactor(HTML): Improve pPara and align handling Split pPara into pParaWithWrapper and pParaSimple helpers. Ensure pParaWithWrapper correctly discards invalid align attributes. Add specific tests for align attribute in HTML reader and writer. --- src/Text/Pandoc/Readers/HTML.hs | 58 +++++++++++++++++++-------------- test/Tests/Readers/HTML.hs | 18 ++++++++++ test/Tests/Writers/HTML.hs | 3 ++ 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index c9c6e0f20cd9..46b1f63a6f81 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -623,39 +623,49 @@ pPlain = do then return mempty else return $ B.plain contents +-- Helper function for pPara when significant attributes are present +pParaWithWrapper :: PandocMonad m => Attr -> TagParser m Blocks +pParaWithWrapper (ident, classes, kvs) = do + guardEnabled Ext_native_divs -- Ensure native_divs is enabled for this behavior + pInhalt <- trimInlines <$> pInTags "p" inline + (do guardDisabled Ext_empty_paragraphs + guard (null pInhalt) + return mempty) <|> do + let wrapperAttr = ("wrapper", "1") + let alignValue = lookup "align" kvs + let otherKVs = filter (\(k,_) -> k /= "align") kvs + let validAlignKV = case alignValue of + Just algn | algn `elem` ["left","right","center","justify"] -> [("align", algn)] + _ -> [] + let finalKVs = wrapperAttr : (validAlignKV ++ otherKVs) + let finalAttrs = (ident, classes, finalKVs) + return $ B.divWith finalAttrs (B.para pInhalt) + +-- Helper function for pPara when only align or no attributes are present +pParaSimple :: PandocMonad m => Maybe Text -> TagParser m Blocks +pParaSimple alignValue = do + contents <- trimInlines <$> pInTags "p" inline + let paraBlock = B.para contents + (do guardDisabled Ext_empty_paragraphs + guard (null contents) + return mempty) <|> + return (case alignValue of + Just algn | algn `elem` ["left","right","center","justify"] -> + B.divWith ("", [], [("align", algn)]) paraBlock + _ -> paraBlock) + pPara :: PandocMonad m => TagParser m Blocks pPara = do TagOpen _ attr' <- lookAhead $ pSatisfy (matchTagOpen "p" []) - let (ident, classes, kvs) = toAttr attr' + let attr@(ident, classes, kvs) = toAttr attr' let alignValue = lookup "align" kvs -- "Significant" attributes are any id, class, or key-value pair other than 'align'. let significantKVs = filter (\(k,_) -> k /= "align") kvs let hasSignificantAttributes = not (T.null ident) || not (null classes) || not (null significantKVs) if hasSignificantAttributes - then do - -- If there are significant attributes, parse as Div with wrapper="1" - -- All original attributes (including align, if present) go on this Div. - guardEnabled Ext_native_divs -- Ensure native_divs is enabled for this behavior - pInhalt <- trimInlines <$> pInTags "p" inline - (do guardDisabled Ext_empty_paragraphs - guard (null pInhalt) - return mempty) <|> do - let wrapperAttr = ("wrapper", "1") - -- Use all original kvs for the Div - let finalAttrs = (ident, classes, wrapperAttr : kvs) - return $ B.divWith finalAttrs (B.para pInhalt) - else do - -- If only 'align' (or no attributes) is present, handle as before. - contents <- trimInlines <$> pInTags "p" inline - let paraBlock = B.para contents - (do guardDisabled Ext_empty_paragraphs - guard (null contents) - return mempty) <|> - return (case alignValue of - Just algn | algn `elem` ["left","right","center","justify"] -> - B.divWith ("", [], [("align", algn)]) paraBlock - _ -> paraBlock) + then pParaWithWrapper attr + else pParaSimple alignValue pFigure :: PandocMonad m => TagParser m Blocks pFigure = do diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 6e07d152fb5b..d2e6da5aa22b 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -156,6 +156,24 @@ tests = [ testGroup "base tag" , test htmlNativeDivs "paragraph without attributes" $ "

This is a normal paragraph.

" =?> doc (para (text "This is a normal paragraph.")) + , test htmlNativeDivs "paragraph with align only (center)" $ + "

Aligned paragraph.

" =?> + doc (divWith ("", [], [("align", "center")]) (para (text "Aligned paragraph."))) + , test htmlNativeDivs "paragraph with align only (right)" $ + "

Aligned paragraph.

" =?> + doc (divWith ("", [], [("align", "right")]) (para (text "Aligned paragraph."))) + , test htmlNativeDivs "paragraph with align and id" $ + "

Aligned paragraph with id.

" =?> + doc (divWith ("foo", [], [("wrapper", "1"), ("align", "left")]) (para (text "Aligned paragraph with id."))) + , test htmlNativeDivs "paragraph with align and class" $ + "

Aligned paragraph with class.

" =?> + doc (divWith ("", ["bar"], [("wrapper", "1"), ("align", "justify")]) (para (text "Aligned paragraph with class."))) + , test htmlNativeDivs "paragraph with invalid align" $ + "

Invalid align.

" =?> + doc (para (text "Invalid align.")) + , test htmlNativeDivs "paragraph with invalid align and id" $ + "

Invalid align with id.

" =?> + doc (divWith ("baz", [], [("wrapper", "1")]) (para (text "Invalid align with id."))) ] , askOption $ \(QuickCheckTests numtests) -> testProperty "Round trip" $ diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index 7c1d7db5662e..95fdba726911 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -233,6 +233,9 @@ tests = , "paragraph with wrapper and other attributes" =: divWith ("mypara", ["important"], [("wrapper", "1"), ("data-value", "123")]) (para (text "This is a paragraph.")) =?> "

This is a paragraph.

" + , "paragraph with wrapper and align" =: + divWith ("mypara", [], [("wrapper", "1"), ("align", "center")]) (para (text "Aligned paragraph.")) + =?> "

Aligned paragraph.

" ] ] where From 377dfbbe0dcf82a5dddecdba2eca0a745402221b Mon Sep 17 00:00:00 2001 From: Valgard Trontheim Date: Sat, 17 May 2025 17:38:11 +0200 Subject: [PATCH 3/6] docs(HTML): Document native_divs behavior for attributed p tags - Update MANUAL.txt to reflect `native_divs` wrapping of attributed `

` tags. --- MANUAL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index 1f9f04362226..cc39bf916990 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5389,7 +5389,7 @@ from being interpreted as Markdown. ### Extension: `native_divs` ### -Use native pandoc `Div` blocks for content inside `

` tags. +Use native pandoc `Div` blocks for content inside `
` tags. This extension also influences how HTML `

` tags with attributes are processed, by wrapping them in `Div` blocks to better preserve their attributes during conversion. For the most part this should give the same output as `markdown_in_html_blocks`, but it makes it easier to write pandoc filters to manipulate groups of blocks. From f4b77f0f1f6b5d73246bb65ba92aa8b70527bbab Mon Sep 17 00:00:00 2001 From: Valgard Trontheim Date: Sat, 17 May 2025 19:16:51 +0200 Subject: [PATCH 4/6] test(HTML): add command tests for attributed p tags - Add test cases for HTML to native, native to HTML, HTML to HTML, and HTML to HTML5 conversions - Verify preservation of id, class, and data attributes on p tags --- test/command/10768.md | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 test/command/10768.md diff --git a/test/command/10768.md b/test/command/10768.md new file mode 100644 index 000000000000..fee0dc6d082d --- /dev/null +++ b/test/command/10768.md @@ -0,0 +1,68 @@ +``` +% pandoc -f html -t native +

This is a paragraph with attributes.

+^D +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +``` + +``` +% pandoc -f native -t html +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc -f html -t html +

This is a paragraph with attributes.

+^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc -f html -t html5 +

This is a paragraph with attributes.

+^D +

This is a paragraph +with attributes.

+``` From 9e65e19a74b2707a6d15e4ac434be2b18158e0ae Mon Sep 17 00:00:00 2001 From: Valgard Trontheim Date: Mon, 9 Jun 2025 00:20:10 +0200 Subject: [PATCH 5/6] fix: remove special handling of align attribute in HTML paragraphs - Treat align attribute like any other attribute - Always wrap paragraphs with attributes in divs (including align-only) - Remove validation logic for align values - Update tests to reflect consistent wrapper behavior --- src/Text/Pandoc/Readers/HTML.hs | 33 +++++++++++---------------------- test/Tests/Readers/HTML.hs | 8 ++++---- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 46b1f63a6f81..09d9ab51bd35 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -627,45 +627,34 @@ pPlain = do pParaWithWrapper :: PandocMonad m => Attr -> TagParser m Blocks pParaWithWrapper (ident, classes, kvs) = do guardEnabled Ext_native_divs -- Ensure native_divs is enabled for this behavior - pInhalt <- trimInlines <$> pInTags "p" inline + contents <- trimInlines <$> pInTags "p" inline (do guardDisabled Ext_empty_paragraphs - guard (null pInhalt) + guard (null contents) return mempty) <|> do let wrapperAttr = ("wrapper", "1") - let alignValue = lookup "align" kvs - let otherKVs = filter (\(k,_) -> k /= "align") kvs - let validAlignKV = case alignValue of - Just algn | algn `elem` ["left","right","center","justify"] -> [("align", algn)] - _ -> [] - let finalKVs = wrapperAttr : (validAlignKV ++ otherKVs) + let finalKVs = wrapperAttr : kvs let finalAttrs = (ident, classes, finalKVs) - return $ B.divWith finalAttrs (B.para pInhalt) + return $ B.divWith finalAttrs (B.para contents) --- Helper function for pPara when only align or no attributes are present -pParaSimple :: PandocMonad m => Maybe Text -> TagParser m Blocks -pParaSimple alignValue = do +-- Helper function for pPara when no significant attributes are present +pParaSimple :: PandocMonad m => TagParser m Blocks +pParaSimple = do contents <- trimInlines <$> pInTags "p" inline - let paraBlock = B.para contents (do guardDisabled Ext_empty_paragraphs guard (null contents) return mempty) <|> - return (case alignValue of - Just algn | algn `elem` ["left","right","center","justify"] -> - B.divWith ("", [], [("align", algn)]) paraBlock - _ -> paraBlock) + return (B.para contents) pPara :: PandocMonad m => TagParser m Blocks pPara = do TagOpen _ attr' <- lookAhead $ pSatisfy (matchTagOpen "p" []) let attr@(ident, classes, kvs) = toAttr attr' - let alignValue = lookup "align" kvs - -- "Significant" attributes are any id, class, or key-value pair other than 'align'. - let significantKVs = filter (\(k,_) -> k /= "align") kvs - let hasSignificantAttributes = not (T.null ident) || not (null classes) || not (null significantKVs) + -- "Significant" attributes are any id, class, or key-value pair. + let hasSignificantAttributes = not (T.null ident) || not (null classes) || not (null kvs) if hasSignificantAttributes then pParaWithWrapper attr - else pParaSimple alignValue + else pParaSimple pFigure :: PandocMonad m => TagParser m Blocks pFigure = do diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index d2e6da5aa22b..80111fc52d3c 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -158,10 +158,10 @@ tests = [ testGroup "base tag" doc (para (text "This is a normal paragraph.")) , test htmlNativeDivs "paragraph with align only (center)" $ "

Aligned paragraph.

" =?> - doc (divWith ("", [], [("align", "center")]) (para (text "Aligned paragraph."))) + doc (divWith ("", [], [("wrapper", "1"), ("align", "center")]) (para (text "Aligned paragraph."))) , test htmlNativeDivs "paragraph with align only (right)" $ "

Aligned paragraph.

" =?> - doc (divWith ("", [], [("align", "right")]) (para (text "Aligned paragraph."))) + doc (divWith ("", [], [("wrapper", "1"), ("align", "right")]) (para (text "Aligned paragraph."))) , test htmlNativeDivs "paragraph with align and id" $ "

Aligned paragraph with id.

" =?> doc (divWith ("foo", [], [("wrapper", "1"), ("align", "left")]) (para (text "Aligned paragraph with id."))) @@ -170,10 +170,10 @@ tests = [ testGroup "base tag" doc (divWith ("", ["bar"], [("wrapper", "1"), ("align", "justify")]) (para (text "Aligned paragraph with class."))) , test htmlNativeDivs "paragraph with invalid align" $ "

Invalid align.

" =?> - doc (para (text "Invalid align.")) + doc (divWith ("", [], [("wrapper", "1"), ("align", "invalid")]) (para (text "Invalid align."))) , test htmlNativeDivs "paragraph with invalid align and id" $ "

Invalid align with id.

" =?> - doc (divWith ("baz", [], [("wrapper", "1")]) (para (text "Invalid align with id."))) + doc (divWith ("baz", [], [("wrapper", "1"), ("align", "invalid")]) (para (text "Invalid align with id."))) ] , askOption $ \(QuickCheckTests numtests) -> testProperty "Round trip" $ From 6a79d05dd4c1bfe145016ce4203ab04937150d7f Mon Sep 17 00:00:00 2001 From: Valgard Trontheim Date: Wed, 30 Jul 2025 15:25:05 +0200 Subject: [PATCH 6/6] refactor: restructure paragraph attribute handling across all writers - Replace monolithic test file with format-specific test suite (32 new test files) - Standardize paragraph attribute processing in 31 writer modules - Add paragraph_attributes extension to control attribute preservation behavior - Update shared writer utilities for consistent attribute handling - Modify HTML tests to reflect new attribute processing logic Fixes #10768 --- src/Text/Pandoc/Extensions.hs | 2 + src/Text/Pandoc/Writers/AsciiDoc.hs | 60 +++--- src/Text/Pandoc/Writers/ConTeXt.hs | 37 ++-- src/Text/Pandoc/Writers/DocBook.hs | 7 +- src/Text/Pandoc/Writers/Docx/OpenXML.hs | 4 +- src/Text/Pandoc/Writers/DokuWiki.hs | 4 +- src/Text/Pandoc/Writers/EPUB.hs | 4 +- src/Text/Pandoc/Writers/FB2.hs | 4 +- src/Text/Pandoc/Writers/HTML.hs | 14 +- src/Text/Pandoc/Writers/Haddock.hs | 114 +++++----- src/Text/Pandoc/Writers/ICML.hs | 10 +- src/Text/Pandoc/Writers/JATS.hs | 18 +- src/Text/Pandoc/Writers/Jira.hs | 6 +- src/Text/Pandoc/Writers/LaTeX.hs | 76 +++---- src/Text/Pandoc/Writers/Man.hs | 2 +- src/Text/Pandoc/Writers/Markdown.hs | 79 +++---- src/Text/Pandoc/Writers/MediaWiki.hs | 10 +- src/Text/Pandoc/Writers/Ms.hs | 4 +- src/Text/Pandoc/Writers/Muse.hs | 7 +- src/Text/Pandoc/Writers/OpenDocument.hs | 6 +- src/Text/Pandoc/Writers/Org.hs | 4 +- .../Pandoc/Writers/Powerpoint/Presentation.hs | 6 +- src/Text/Pandoc/Writers/RST.hs | 46 ++-- src/Text/Pandoc/Writers/RTF.hs | 2 +- src/Text/Pandoc/Writers/Shared.hs | 9 + src/Text/Pandoc/Writers/TEI.hs | 2 +- src/Text/Pandoc/Writers/Texinfo.hs | 2 +- src/Text/Pandoc/Writers/Textile.hs | 13 +- src/Text/Pandoc/Writers/Typst.hs | 36 ++-- src/Text/Pandoc/Writers/XWiki.hs | 4 +- src/Text/Pandoc/Writers/ZimWiki.hs | 11 +- test/Tests/Writers/HTML.hs | 48 +++-- test/command/10768.md | 68 ------ test/command/10768/asciidoc.md | 89 ++++++++ test/command/10768/basic.md | 196 ++++++++++++++++++ test/command/10768/commonmark.md | 92 ++++++++ test/command/10768/context.md | 86 ++++++++ test/command/10768/docbook.md | 94 +++++++++ test/command/10768/docbook5.md | 94 +++++++++ test/command/10768/docx.md | 112 ++++++++++ test/command/10768/dokuwiki.md | 91 ++++++++ test/command/10768/epub.md | 57 +++++ test/command/10768/fb2.md | 86 ++++++++ test/command/10768/haddock.md | 84 ++++++++ test/command/10768/html.md | 82 ++++++++ test/command/10768/icml.md | 104 ++++++++++ test/command/10768/jats.md | 87 ++++++++ test/command/10768/jira.md | 88 ++++++++ test/command/10768/latex.md | 86 ++++++++ test/command/10768/man.md | 88 ++++++++ test/command/10768/markdown.md | 88 ++++++++ test/command/10768/mediawiki.md | 95 +++++++++ test/command/10768/ms.md | 88 ++++++++ test/command/10768/muse.md | 87 ++++++++ test/command/10768/odt.md | 118 +++++++++++ test/command/10768/opendocument.md | 88 ++++++++ test/command/10768/org.md | 88 ++++++++ test/command/10768/plain.md | 83 ++++++++ test/command/10768/powerpoint.md | 78 +++++++ test/command/10768/rst.md | 90 ++++++++ test/command/10768/rtf.md | 83 ++++++++ test/command/10768/tei.md | 83 ++++++++ test/command/10768/texinfo.md | 96 +++++++++ test/command/10768/textile.md | 89 ++++++++ test/command/10768/typst.md | 92 ++++++++ test/command/10768/xwiki.md | 87 ++++++++ test/command/10768/zimwiki.md | 87 ++++++++ 67 files changed, 3505 insertions(+), 350 deletions(-) delete mode 100644 test/command/10768.md create mode 100644 test/command/10768/asciidoc.md create mode 100644 test/command/10768/basic.md create mode 100644 test/command/10768/commonmark.md create mode 100644 test/command/10768/context.md create mode 100644 test/command/10768/docbook.md create mode 100644 test/command/10768/docbook5.md create mode 100644 test/command/10768/docx.md create mode 100644 test/command/10768/dokuwiki.md create mode 100644 test/command/10768/epub.md create mode 100644 test/command/10768/fb2.md create mode 100644 test/command/10768/haddock.md create mode 100644 test/command/10768/html.md create mode 100644 test/command/10768/icml.md create mode 100644 test/command/10768/jats.md create mode 100644 test/command/10768/jira.md create mode 100644 test/command/10768/latex.md create mode 100644 test/command/10768/man.md create mode 100644 test/command/10768/markdown.md create mode 100644 test/command/10768/mediawiki.md create mode 100644 test/command/10768/ms.md create mode 100644 test/command/10768/muse.md create mode 100644 test/command/10768/odt.md create mode 100644 test/command/10768/opendocument.md create mode 100644 test/command/10768/org.md create mode 100644 test/command/10768/plain.md create mode 100644 test/command/10768/powerpoint.md create mode 100644 test/command/10768/rst.md create mode 100644 test/command/10768/rtf.md create mode 100644 test/command/10768/tei.md create mode 100644 test/command/10768/texinfo.md create mode 100644 test/command/10768/textile.md create mode 100644 test/command/10768/typst.md create mode 100644 test/command/10768/xwiki.md create mode 100644 test/command/10768/zimwiki.md diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index f1c9c0f379fe..7ff9c13c2937 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -109,6 +109,7 @@ data Extension = | Ext_ntb -- ^ ConTeXt Natural Tables | Ext_old_dashes -- ^ -- = em, - before number = en | Ext_pandoc_title_block -- ^ Pandoc title block + | Ext_paragraph_attributes -- ^ Allow paragraph attributes in HTML | Ext_pipe_tables -- ^ Pipe tables (as in PHP markdown extra) | Ext_raw_attribute -- ^ Allow explicit raw blocks/inlines | Ext_raw_html -- ^ Allow raw HTML @@ -598,6 +599,7 @@ getAllExtensions f = universalExtensions <> getAll f , Ext_literate_haskell , Ext_epub_html_exts , Ext_smart + , Ext_paragraph_attributes ] getAll "html4" = getAll "html" getAll "html5" = getAll "html" diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index fb0ce0db1fde..43308479ffe3 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -377,34 +377,38 @@ blockToAsciiDoc opts (DefinitionList items) = do return $ mconcat contents <> blankline -- convert admonition and sidebar divs to asicidoc -blockToAsciiDoc opts (Div (ident,classes,_) bs) = do - let identifier = if T.null ident then empty else "[[" <> literal ident <> "]]" - let admonition_classes = ["attention","caution","danger","error","hint", - "important","note","tip","warning"] - let sidebar_class = "sidebar" - - contents <- - case classes of - (l:_) | l `elem` admonition_classes || T.toLower l == sidebar_class -> do - let (titleBs, bodyBs) = - case bs of - (Div (_,["title"],_) ts : rest) -> (ts, rest) - _ -> ([], bs) - let fence = if l == "sidebar" then "****" else "====" - elemTitle <- if null titleBs || - -- If title matches class, omit - (T.toLower (T.strip (stringify titleBs))) == l - then return mempty - else ("." <>) <$> - blockListToAsciiDoc opts titleBs - elemBody <- blockListToAsciiDoc opts bodyBs - return $ "[" <> literal (T.toUpper l) <> "]" $$ - chomp elemTitle $$ - fence $$ - chomp elemBody $$ - fence - _ -> blockListToAsciiDoc opts bs - return $ identifier $$ contents $$ blankline +blockToAsciiDoc opts divBlock@(Div (ident,classes,_) bs) = do + -- First try to unwrap wrapper divs + case unwrapWrapperDiv divBlock of + Para inlines -> blockToAsciiDoc opts (Para inlines) + _ -> do + let identifier = if T.null ident then empty else "[[" <> literal ident <> "]]" + let admonition_classes = ["attention","caution","danger","error","hint", + "important","note","tip","warning"] + let sidebar_class = "sidebar" + + contents <- + case classes of + (l:_) | l `elem` admonition_classes || T.toLower l == sidebar_class -> do + let (titleBs, bodyBs) = + case bs of + (Div (_,["title"],_) ts : rest) -> (ts, rest) + _ -> ([], bs) + let fence = if l == "sidebar" then "****" else "====" + elemTitle <- if null titleBs || + -- If title matches class, omit + (T.toLower (T.strip (stringify titleBs))) == l + then return mempty + else ("." <>) <$> + blockListToAsciiDoc opts titleBs + elemBody <- blockListToAsciiDoc opts bodyBs + return $ "[" <> literal (T.toUpper l) <> "]" $$ + chomp elemTitle $$ + fence $$ + chomp elemBody $$ + fence + _ -> blockListToAsciiDoc opts bs + return $ identifier $$ contents $$ blankline -- | Convert bullet list item (list of blocks) to asciidoc. bulletListItemToAsciiDoc :: PandocMonad m diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 65a0fa9ddaae..4a13eed3e5bb 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -38,7 +38,7 @@ import Text.Pandoc.Shared import Text.Pandoc.URI (isURI) import Text.Pandoc.Templates (renderTemplate) import Text.Pandoc.Walk (query) -import Text.Pandoc.Writers.Shared +import Text.Pandoc.Writers.Shared (unwrapWrapperDiv, defField, getField, resetField, lookupMetaString, metaToContext, getLang) import Text.Printf (printf) import qualified Data.List.NonEmpty as NonEmpty @@ -187,37 +187,40 @@ toLabel z = T.concatMap go z -- | Convert Pandoc block element to ConTeXt. blockToConTeXt :: PandocMonad m => Block -> WM m (Doc Text) -blockToConTeXt (Div attr@(_,"section":_,_) +blockToConTeXt block = blockToConTeXt' (unwrapWrapperDiv block) + +blockToConTeXt' :: PandocMonad m => Block -> WM m (Doc Text) +blockToConTeXt' (Div attr@(_,"section":_,_) (Header level _ title' : xs)) = do header' <- sectionHeader attr level title' SectionHeading footer' <- sectionFooter attr level innerContents <- blockListToConTeXt xs return $ header' $$ innerContents $$ footer' -blockToConTeXt (Plain lst) = do +blockToConTeXt' (Plain lst) = do opts <- gets stOptions contents <- inlineListToConTeXt lst return $ if isEnabled Ext_tagging opts then "\\bpar{}" <> contents <> "\\epar{}" else contents -blockToConTeXt (Para lst) = do +blockToConTeXt' (Para lst) = do opts <- gets stOptions contents <- inlineListToConTeXt lst return $ if isEnabled Ext_tagging opts then "\\bpar" $$ contents $$ "\\epar" <> blankline else contents <> blankline -blockToConTeXt (LineBlock lns) = do +blockToConTeXt' (LineBlock lns) = do let emptyToBlankline doc = if isEmpty doc then blankline else doc doclines <- mapM inlineListToConTeXt lns let contextLines = vcat . map emptyToBlankline $ doclines return $ "\\startlines" $$ contextLines $$ "\\stoplines" <> blankline -blockToConTeXt (BlockQuote lst) = do +blockToConTeXt' (BlockQuote lst) = do contents <- blockListToConTeXt lst return $ "\\startblockquote" $$ nest 0 contents $$ "\\stopblockquote" <> blankline -blockToConTeXt (CodeBlock (_ident, classes, kv) str) = do +blockToConTeXt' (CodeBlock (_ident, classes, kv) str) = do opts <- gets stOptions let syntaxMap = writerSyntaxMap opts let attr' = ("", classes, kv) @@ -236,15 +239,15 @@ blockToConTeXt (CodeBlock (_ident, classes, kv) str) = do if null classes || isNothing (writerHighlightStyle opts) then pure unhighlighted else highlighted -blockToConTeXt b@(RawBlock f str) +blockToConTeXt' b@(RawBlock f str) | f == Format "context" || f == Format "tex" = return $ literal str <> blankline | otherwise = empty <$ report (BlockNotRendered b) -blockToConTeXt (Div ("refs",classes,_) bs) = do +blockToConTeXt' (Div ("refs",classes,_) bs) = do modify $ \st -> st{ stHasCslRefs = True , stCslHangingIndent = "hanging-indent" `elem` classes } inner <- blockListToConTeXt bs return $ "\\startcslreferences" $$ inner $$ "\\stopcslreferences" -blockToConTeXt (Div (ident,_,kvs) bs) = do +blockToConTeXt' (Div (ident,_,kvs) bs) = do let align dir txt = "\\startalignment[" <> dir <> "]" $$ txt $$ "\\stopalignment" mblang <- fromBCP47 (lookup "lang" kvs) let wrapRef txt = if T.null ident @@ -261,13 +264,13 @@ blockToConTeXt (Div (ident,_,kvs) bs) = do Nothing -> txt wrapBlank txt = blankline <> txt <> blankline wrapBlank . wrapLang . wrapDir . wrapRef <$> blockListToConTeXt bs -blockToConTeXt (BulletList lst) = do +blockToConTeXt' (BulletList lst) = do contents <- mapM listItemToConTeXt lst return $ ("\\startitemize" <> if isTightList lst then brackets "packed" else empty) $$ vcat contents $$ literal "\\stopitemize" <> blankline -blockToConTeXt (OrderedList (start, style', delim) lst) = do +blockToConTeXt' (OrderedList (start, style', delim) lst) = do st <- get let level = stOrderedListLevel st put st {stOrderedListLevel = level + 1} @@ -295,15 +298,15 @@ blockToConTeXt (OrderedList (start, style', delim) lst) = do let specs = T.pack style'' <> specs2 return $ "\\startenumerate" <> literal specs $$ vcat contents $$ "\\stopenumerate" <> blankline -blockToConTeXt (DefinitionList lst) = +blockToConTeXt' (DefinitionList lst) = liftM vcat $ mapM defListItemToConTeXt lst -blockToConTeXt HorizontalRule = return $ "\\thinrule" <> blankline +blockToConTeXt' HorizontalRule = return $ "\\thinrule" <> blankline -- If this is ever executed, provide a default for the reference identifier. -blockToConTeXt (Header level attr lst) = +blockToConTeXt' (Header level attr lst) = sectionHeader attr level lst NonSectionHeading -blockToConTeXt (Table attr caption colspecs thead tbody tfoot) = +blockToConTeXt' (Table attr caption colspecs thead tbody tfoot) = tableToConTeXt (Ann.toTable attr caption colspecs thead tbody tfoot) -blockToConTeXt (Figure (ident, _, _) (Caption cshort clong) body) = do +blockToConTeXt' (Figure (ident, _, _) (Caption cshort clong) body) = do title <- inlineListToConTeXt (blocksToInlines clong) list <- maybe (pure empty) inlineListToConTeXt cshort content <- blockListToConTeXt body diff --git a/src/Text/Pandoc/Writers/DocBook.hs b/src/Text/Pandoc/Writers/DocBook.hs index 775a92befa33..6de8052fe2eb 100644 --- a/src/Text/Pandoc/Writers/DocBook.hs +++ b/src/Text/Pandoc/Writers/DocBook.hs @@ -204,10 +204,11 @@ blockToDocBook opts (Div (id',"section":_classes,divattrs) title' <- inlinesToDocBook opts ils contents <- blocksToDocBook opts bs return $ inTags True tag attribs $ inTagsSimple "title" title' $$ contents -blockToDocBook opts (Div (ident,classes,_) bs) = do +blockToDocBook opts (Div (ident,classes,_kvs) bs) = do version <- ask let identAttribs = [(idName version, ident) | not (T.null ident)] admonitions = ["caution","danger","important","note","tip","warning"] + case classes of (l:_) | l `elem` admonitions -> do let (mTitleBs, bodyBs) = @@ -219,13 +220,15 @@ blockToDocBook opts (Div (ident,classes,_) bs) = do _ -> (Nothing, bs) admonitionTitle <- case mTitleBs of Nothing -> return mempty - -- id will be attached to the admonition so let’s pass empty identAttrs. + -- id will be attached to the admonition so let's pass empty identAttrs. Just titleBs -> inTagsSimple "title" <$> titleBs admonitionBody <- handleDivBody [] bodyBs return (inTags True l identAttribs (admonitionTitle $$ admonitionBody)) _ -> handleDivBody identAttribs bs where handleDivBody identAttribs [Para lst] = + -- For wrapper divs with single Para, apply attributes to para + -- For normal divs with single Para, also apply attributes to para (original behavior) if hasLineBreaks lst then flush . nowrap . inTags False "literallayout" identAttribs <$> inlinesToDocBook opts lst diff --git a/src/Text/Pandoc/Writers/Docx/OpenXML.hs b/src/Text/Pandoc/Writers/Docx/OpenXML.hs index 0b76153f4b1c..a57c5c0ac777 100644 --- a/src/Text/Pandoc/Writers/Docx/OpenXML.hs +++ b/src/Text/Pandoc/Writers/Docx/OpenXML.hs @@ -227,6 +227,8 @@ writeOpenXML :: PandocMonad m -> WS m (Text, [Element], [Element]) writeOpenXML opts (Pandoc meta blocks) = do setupTranslations meta + -- Apply unwrapWrapperDiv to all blocks + let blocks' = walk unwrapWrapperDiv blocks let includeTOC = writerTableOfContents opts || lookupMetaBool "toc" meta let includeLOF = writerListOfFigures opts || lookupMetaBool "lof" meta let includeLOT = writerListOfTables opts || lookupMetaBool "lot" meta @@ -252,7 +254,7 @@ writeOpenXML opts (Pandoc meta blocks) = do (fmap (hcat . map (literal . showContent)) . inlinesToOpenXML opts) (docAuthors meta) - doc' <- setFirstPara >> blocksToOpenXML opts blocks + doc' <- setFirstPara >> blocksToOpenXML opts blocks' let body = vcat $ map (literal . showContent) doc' notes' <- gets (reverse . stFootnotes) comments <- gets (reverse . stComments) diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 34ea2e3bd76e..4840ee6cb922 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -41,7 +41,7 @@ import Text.Pandoc.Shared (figureDiv, linesToPara, removeFormatting, trimr) import Text.Pandoc.URI (escapeURI, isURI) import Text.Pandoc.Templates (renderTemplate) import Text.DocLayout (render, literal) -import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable) +import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable, unwrapWrapperDiv) import Data.Maybe (fromMaybe) import qualified Data.Map as M @@ -101,7 +101,7 @@ blockToDokuWiki :: PandocMonad m -> DokuWiki m Text blockToDokuWiki opts (Div _attrs bs) = do - contents <- blockListToDokuWiki opts bs + contents <- blockListToDokuWiki opts (map unwrapWrapperDiv bs) indent <- asks stIndent return $ contents <> if T.null indent then "\n" else "" diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index f1d4bb95e0a6..3d771b842fd1 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -35,7 +35,7 @@ import qualified Data.Text.Lazy as TL import System.FilePath (takeExtension, takeFileName, makeRelative) import Text.HTML.TagSoup (Tag (TagOpen), fromAttrib, parseTags) import Text.Pandoc.Builder (fromList, setMeta) -import Text.Pandoc.Writers.Shared (ensureValidXmlIdentifiers) +import Text.Pandoc.Writers.Shared (ensureValidXmlIdentifiers, unwrapWrapperDiv) import Data.Tree (Tree(..)) import Text.Pandoc.Class (PandocMonad, report) import qualified Text.Pandoc.Class.PandocPure as P @@ -1211,7 +1211,7 @@ transformBlock (RawBlock fmt raw) let tags = parseTags raw tags' <- mapM transformTag tags return $ RawBlock fmt (renderTags' tags') -transformBlock b = return b +transformBlock b = return $ unwrapWrapperDiv b transformInline :: PandocMonad m => WriterOptions diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index fd4e01d4697e..ffc756c235d8 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -41,7 +41,7 @@ import Text.Pandoc.Shared (blocksToInlines, capitalize, orderedListMarkers, makeSections, tshow, stringify) import Text.Pandoc.Walk (walk) import Text.Pandoc.Writers.Shared (lookupMetaString, toLegacyTable, - ensureValidXmlIdentifiers) + ensureValidXmlIdentifiers, unwrapWrapperDiv) import Data.Generics (everywhere, mkT) -- | Data to be written at the end of the document: @@ -315,7 +315,7 @@ blockToXml (RawBlock f str) = Left msg -> throwError $ PandocXMLError "" msg Right nds -> return nds else return [] -blockToXml (Div _ bs) = cMapM blockToXml bs +blockToXml (Div _ bs) = cMapM blockToXml (map unwrapWrapperDiv bs) blockToXml (BlockQuote bs) = list . el "cite" <$> cMapM blockToXml bs blockToXml (LineBlock lns) = list . el "poem" <$> mapM stanza (split null lns) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index bf02a301ab70..a67efa8d7692 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -752,11 +752,17 @@ blockToHtmlInner opts (LineBlock lns) = do return $ H.div ! A.class_ "line-block" $ htmlLines blockToHtmlInner opts (Div (ident, classes, kvs) [Para pans]) | Just "1" <- lookup "wrapper" kvs = do -- This is a paragraph that was wrapped in a Div by the reader - -- Unwrap it back to a

tag, transferring attributes from the Div - let pKVs = filter (\(k,_) -> k /= "wrapper") kvs - let pAttr = (ident, classes, pKVs) + -- Unwrap it back to a

tag, with extension-controlled attribute handling inner <- inlineListToHtml opts pans - addAttrs opts pAttr (H.p inner) + if isEnabled Ext_paragraph_attributes opts + then do + -- Extension enabled: preserve all attributes except wrapper + let pKVs = filter (\(k,_) -> k /= "wrapper") kvs + let pAttr = (ident, classes, pKVs) + addAttrs opts pAttr (H.p inner) + else + -- Extension disabled: remove all attributes + return (H.p inner) blockToHtmlInner opts (Div (ident, "section":dclasses, dkvs) (Header level hattr@(hident,hclasses,hkvs) ils : xs)) = do diff --git a/src/Text/Pandoc/Writers/Haddock.hs b/src/Text/Pandoc/Writers/Haddock.hs index 6330259b0f0b..af47316e26cd 100644 --- a/src/Text/Pandoc/Writers/Haddock.hs +++ b/src/Text/Pandoc/Writers/Haddock.hs @@ -93,62 +93,64 @@ blockToHaddock :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> StateT WriterState m (Doc Text) -blockToHaddock opts (Div _ ils) = do - contents <- blockListToHaddock opts ils - return $ contents <> blankline -blockToHaddock opts (Plain inlines) = do - contents <- inlineListToHaddock opts inlines - return $ contents <> cr -blockToHaddock opts (Para inlines) = - -- TODO: if it contains linebreaks, we need to use a @...@ block - (<> blankline) `fmap` blockToHaddock opts (Plain inlines) -blockToHaddock opts (LineBlock lns) = - blockToHaddock opts $ linesToPara lns -blockToHaddock _ b@(RawBlock f str) - | f == "haddock" = - return $ literal str <> text "\n" - | otherwise = do - report $ BlockNotRendered b - return empty -blockToHaddock opts HorizontalRule = - return $ blankline <> text (replicate (writerColumns opts) '_') <> blankline -blockToHaddock opts (Header level (ident,_,_) inlines) = do - contents <- inlineListToHaddock opts inlines - let attr' = if T.null ident - then empty - else cr <> text "#" <> literal ident <> text "#" - return $ nowrap (text (replicate level '=') <> space <> contents) - <> attr' <> blankline -blockToHaddock _ (CodeBlock (_,_,_) str) = - return $ prefixed "> " (literal str) <> blankline --- Nothing in haddock corresponds to block quotes: -blockToHaddock opts (BlockQuote blocks) = - blockListToHaddock opts blocks -blockToHaddock opts (Table _ blkCapt specs thead tbody tfoot) = do - let Caption _ caption = blkCapt - caption' <- blockListToHaddock opts caption - let caption'' = if null caption - then empty - else blankline <> caption' <> blankline - tbl <- gridTable opts blockListToHaddock specs thead tbody tfoot - return $ (tbl $$ blankline $$ caption'') $$ blankline -blockToHaddock opts (BulletList items) = do - contents <- mapM (bulletListItemToHaddock opts) items - return $ (if isTightList items then vcat else vsep) contents <> blankline -blockToHaddock opts (OrderedList (start,_,delim) items) = do - let attribs = (start, Decimal, delim) - let markers = orderedListMarkers attribs - let markers' = map (\m -> if T.length m < 3 - then m <> T.replicate (3 - T.length m) " " - else m) markers - contents <- zipWithM (orderedListItemToHaddock opts) markers' items - return $ (if isTightList items then vcat else vsep) contents <> blankline -blockToHaddock opts (DefinitionList items) = do - contents <- mapM (definitionListItemToHaddock opts) items - return $ vcat contents <> blankline -blockToHaddock opts (Figure _ (Caption _ longcapt) body) = - -- Haddock has no concept of figures, floats, or captions. - fmap (<> blankline) (blockListToHaddock opts (body ++ longcapt)) +blockToHaddock opts block = case unwrapWrapperDiv block of + Para inlines -> do + -- TODO: if it contains linebreaks, we need to use a @...@ block + contents <- inlineListToHaddock opts inlines + return $ contents <> blankline + Div _ ils -> do + contents <- blockListToHaddock opts ils + return $ contents <> blankline + Plain inlines -> do + contents <- inlineListToHaddock opts inlines + return $ contents <> cr + LineBlock lns -> + blockToHaddock opts $ linesToPara lns + b@(RawBlock f str) + | f == "haddock" -> + return $ literal str <> text "\n" + | otherwise -> do + report $ BlockNotRendered b + return empty + HorizontalRule -> + return $ blankline <> text (replicate (writerColumns opts) '_') <> blankline + Header level (ident,_,_) inlines -> do + contents <- inlineListToHaddock opts inlines + let attr' = if T.null ident + then empty + else cr <> text "#" <> literal ident <> text "#" + return $ nowrap (text (replicate level '=') <> space <> contents) + <> attr' <> blankline + CodeBlock (_,_,_) str -> + return $ prefixed "> " (literal str) <> blankline + -- Nothing in haddock corresponds to block quotes: + BlockQuote blocks -> + blockListToHaddock opts blocks + Table _ blkCapt specs thead tbody tfoot -> do + let Caption _ caption = blkCapt + caption' <- blockListToHaddock opts caption + let caption'' = if null caption + then empty + else blankline <> caption' <> blankline + tbl <- gridTable opts blockListToHaddock specs thead tbody tfoot + return $ (tbl $$ blankline $$ caption'') $$ blankline + BulletList items -> do + contents <- mapM (bulletListItemToHaddock opts) items + return $ (if isTightList items then vcat else vsep) contents <> blankline + OrderedList (start,_,delim) items -> do + let attribs = (start, Decimal, delim) + let markers = orderedListMarkers attribs + let markers' = map (\m -> if T.length m < 3 + then m <> T.replicate (3 - T.length m) " " + else m) markers + contents <- zipWithM (orderedListItemToHaddock opts) markers' items + return $ (if isTightList items then vcat else vsep) contents <> blankline + DefinitionList items -> do + contents <- mapM (definitionListItemToHaddock opts) items + return $ vcat contents <> blankline + Figure _ (Caption _ longcapt) body -> + -- Haddock has no concept of figures, floats, or captions. + fmap (<> blankline) (blockListToHaddock opts (body ++ longcapt)) -- | Convert bullet list item (list of blocks) to haddock bulletListItemToHaddock :: PandocMonad m diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index 1d766ab13072..d7d476dd02b4 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -383,9 +383,13 @@ blockToICML opts style (Table attr blkCapt specs thead tbody tfoot) = , ("ColumnCount", tshow nrCols) ] (colDescs $$ cells) liftM2 ($$) tableDoc $ parStyle opts (tableCaptionName:style) "" caption -blockToICML opts style (Div (_ident, _, kvs) lst) = - let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs - in blocksToICML opts (dynamicStyle <> style) lst +blockToICML opts style block@(Div (_, _, kvs) lst) = + case unwrapWrapperDiv block of + Para inlines -> blockToICML opts style (Para inlines) + Div {} -> + let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs + in blocksToICML opts (dynamicStyle <> style) lst + other -> blockToICML opts style other blockToICML opts style (Figure attr capt@(Caption _ longcapt) body) = case body of [Plain [img@(Image {})]] -> do diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index d7975bff3d6b..8b32e8923aa1 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -358,13 +358,17 @@ blockToJATS opts (Div (ident,[cls],kvs) bs) | cls `elem` ["fig", "caption", "tab [(k,v) | (k,v) <- kvs, k `elem` ["specific-use", "content-type", "orientation", "position"]] return $ inTags True cls attr contents -blockToJATS opts (Div (ident,_,kvs) bs) = do - contents <- blocksToJATS opts bs - let attr = [("id", escapeNCName ident) | not (T.null ident)] ++ - [("xml:lang",l) | ("lang",l) <- kvs] ++ - [(k,v) | (k,v) <- kvs, k `elem` ["specific-use", - "content-type", "orientation", "position"]] - return $ inTags True "boxed-text" attr contents +blockToJATS opts (Div (ident,classes,kvs) bs) = do + -- First try to unwrap wrapper divs + case unwrapWrapperDiv (Div (ident,classes,kvs) bs) of + Para inlines -> blockToJATS opts (Para inlines) + _ -> do + contents <- blocksToJATS opts bs + let attr = [("id", escapeNCName ident) | not (T.null ident)] ++ + [("xml:lang",l) | ("lang",l) <- kvs] ++ + [(k,v) | (k,v) <- kvs, k `elem` ["specific-use", + "content-type", "orientation", "position"]] + return $ inTags True "boxed-text" attr contents blockToJATS opts (Header _ _ title) = do title' <- inlinesToJATS opts (map fixLineBreak title) return $ inTagsSimple "title" title' diff --git a/src/Text/Pandoc/Writers/Jira.hs b/src/Text/Pandoc/Writers/Jira.hs index ad0640eb7ccb..b2de757c7b76 100644 --- a/src/Text/Pandoc/Writers/Jira.hs +++ b/src/Text/Pandoc/Writers/Jira.hs @@ -28,7 +28,7 @@ import Text.Pandoc.Options (WriterOptions (writerTemplate, writerWrapText), import Text.Pandoc.Shared (linesToPara, stringify) import Text.Pandoc.Templates (renderTemplate) import Text.Pandoc.Writers.Math (texMathToInlines) -import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable) +import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable, unwrapWrapperDiv) import Text.DocLayout (literal, render) import qualified Data.Text as T import qualified Text.Jira.Markup as Jira @@ -93,7 +93,9 @@ toJiraBlocks blocks = do <$> toJiraItems items CodeBlock attr cs -> toJiraCode attr cs DefinitionList items -> toJiraDefinitionList items - Div attr bs -> toJiraPanel attr bs + Div attr bs -> case unwrapWrapperDiv (Div attr bs) of + Para inlines -> singleton . Jira.Para <$> toJiraInlines inlines + _ -> toJiraPanel attr bs Header lvl attr xs -> toJiraHeader lvl attr xs HorizontalRule -> return . singleton $ Jira.HorizontalRule LineBlock xs -> toJiraBlocks [linesToPara xs] diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index f9261eb877c4..7627c4ae168a 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -374,42 +374,46 @@ blockToLaTeX (Div (identifier@(T.uncons -> Just (_,_)),dclasses,dkvs) -- move identifier from div to header blockToLaTeX (Div ("",dclasses,dkvs) (Header lvl (identifier,hclasses,hkvs) ils : bs)) -blockToLaTeX (Div (identifier,classes,kvs) bs) = do - beamer <- gets stBeamer - oldIncremental <- gets stIncremental - if beamer && "incremental" `elem` classes - then modify $ \st -> st{ stIncremental = True } - else when (beamer && "nonincremental" `elem` classes) $ - modify $ \st -> st { stIncremental = False } - result <- if (identifier == "refs" || -- <- for backwards compatibility - "csl-bib-body" `elem` classes) && - (not (null bs)) - then do - modify $ \st -> st{ stHasCslRefs = True } - inner <- blockListToLaTeX bs - return $ ("\\begin{CSLReferences}" - <> braces - (if "hanging-indent" `elem` classes - then "1" - else "0") - <> braces - (maybe "1" literal (lookup "entry-spacing" kvs))) - $$ inner - $+$ "\\end{CSLReferences}" - else blockListToLaTeX bs - modify $ \st -> st{ stIncremental = oldIncremental } - let wrap txt - | beamer && "notes" `elem` classes - = pure ("\\note" <> braces txt) -- speaker notes - | "ref-" `T.isPrefixOf` identifier - = do - lab <- toLabel identifier - pure $ ("\\bibitem" <> brackets "\\citeproctext" - <> braces (literal lab)) $$ txt - | otherwise = do - linkAnchor <- hypertarget identifier - pure $ linkAnchor $$ txt - wrapDiv (identifier,classes,kvs) result >>= wrap +blockToLaTeX divBlock@(Div (identifier,classes,kvs) bs) = do + -- First try to unwrap wrapper divs + case unwrapWrapperDiv divBlock of + Para inlines -> blockToLaTeX (Para inlines) + _ -> do + beamer <- gets stBeamer + oldIncremental <- gets stIncremental + if beamer && "incremental" `elem` classes + then modify $ \st -> st{ stIncremental = True } + else when (beamer && "nonincremental" `elem` classes) $ + modify $ \st -> st { stIncremental = False } + result <- if (identifier == "refs" || -- <- for backwards compatibility + "csl-bib-body" `elem` classes) && + (not (null bs)) + then do + modify $ \st -> st{ stHasCslRefs = True } + inner <- blockListToLaTeX bs + return $ ("\\begin{CSLReferences}" + <> braces + (if "hanging-indent" `elem` classes + then "1" + else "0") + <> braces + (maybe "1" literal (lookup "entry-spacing" kvs))) + $$ inner + $+$ "\\end{CSLReferences}" + else blockListToLaTeX bs + modify $ \st -> st{ stIncremental = oldIncremental } + let wrap txt + | beamer && "notes" `elem` classes + = pure ("\\note" <> braces txt) -- speaker notes + | "ref-" `T.isPrefixOf` identifier + = do + lab <- toLabel identifier + pure $ ("\\bibitem" <> brackets "\\citeproctext" + <> braces (literal lab)) $$ txt + | otherwise = do + linkAnchor <- hypertarget identifier + pure $ linkAnchor $$ txt + wrapDiv (identifier,classes,kvs) result >>= wrap blockToLaTeX (Plain lst) = inlineListToLaTeX lst -- . . . indicates pause in beamer slides diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 23eff037fc79..c549c841e5f9 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -113,7 +113,7 @@ blockToMan :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> StateT WriterState m (Doc Text) -blockToMan opts (Div _ bs) = blockListToMan opts bs +blockToMan opts (Div _ bs) = blockListToMan opts (map unwrapWrapperDiv bs) blockToMan opts (Plain inlines) = splitSentences <$> inlineListToMan opts inlines blockToMan opts (Para inlines) = do diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 476b54286821..76c9c318959c 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -386,43 +386,48 @@ blockToMarkdown' opts (Div attrs@(_,classes,_) bs) "important" -> "[!IMPORTANT]\n" _ -> "[!NOTE]\n") : ils)) : bs' | otherwise = do - contents <- blockListToMarkdown opts bs - variant <- asks envVariant - return $ - case () of - _ | variant == Markua -> - case () of - () | "blurb" `elem` classes' - -> prefixed "B> " contents <> blankline - | "aside" `elem` classes' - -> prefixed "A> " contents <> blankline - -- necessary to enable option to create a bibliography - | (take 3 (T.unpack id')) == "ref" - -> contents <> blankline - | otherwise -> contents <> blankline - | isEnabled Ext_fenced_divs opts -> - let attrsToMd = if variant == Commonmark - then attrsToMarkdown opts - else classOrAttrsToMarkdown opts - divNesting = computeDivNestingLevel bs - numcolons = 3 + divNesting - colons = literal $ T.replicate numcolons ":" - in nowrap (colons <+> attrsToMd attrs) $$ - chomp contents $$ - colons <> blankline - | isEnabled Ext_native_divs opts || - (isEnabled Ext_raw_html opts && - (variant == Commonmark || - isEnabled Ext_markdown_in_html_blocks opts)) -> - tagWithAttrs "div" attrs <> blankline <> - contents <> blankline <> "

" <> blankline - | isEnabled Ext_raw_html opts && - isEnabled Ext_markdown_attribute opts -> - tagWithAttrs "div" attrs' <> blankline <> - contents <> blankline <> "
" <> blankline - | otherwise -> contents <> blankline - where (id',classes',kvs') = attrs - attrs' = (id',classes',("markdown","1"):kvs') + -- Apply unwrapWrapperDiv to handle wrapper divs + case unwrapWrapperDiv (Div attrs bs) of + Para inlines -> blockToMarkdown' opts (Para inlines) + unwrapped | unwrapped /= Div attrs bs -> blockToMarkdown' opts unwrapped + _ -> do + contents <- blockListToMarkdown opts bs + variant <- asks envVariant + return $ + case () of + _ | variant == Markua -> + case () of + () | "blurb" `elem` classes' + -> prefixed "B> " contents <> blankline + | "aside" `elem` classes' + -> prefixed "A> " contents <> blankline + -- necessary to enable option to create a bibliography + | (take 3 (T.unpack id')) == "ref" + -> contents <> blankline + | otherwise -> contents <> blankline + | isEnabled Ext_fenced_divs opts -> + let attrsToMd = if variant == Commonmark + then attrsToMarkdown opts + else classOrAttrsToMarkdown opts + divNesting = computeDivNestingLevel bs + numcolons = 3 + divNesting + colons = literal $ T.replicate numcolons ":" + in nowrap (colons <+> attrsToMd attrs) $$ + chomp contents $$ + colons <> blankline + | isEnabled Ext_native_divs opts || + (isEnabled Ext_raw_html opts && + (variant == Commonmark || + isEnabled Ext_markdown_in_html_blocks opts)) -> + tagWithAttrs "div" attrs <> blankline <> + contents <> blankline <> "" <> blankline + | isEnabled Ext_raw_html opts && + isEnabled Ext_markdown_attribute opts -> + tagWithAttrs "div" attrs' <> blankline <> + contents <> blankline <> "" <> blankline + | otherwise -> contents <> blankline + where (id',classes',kvs') = attrs + attrs' = (id',classes',("markdown","1"):kvs') blockToMarkdown' opts (Plain inlines) = do -- escape if para starts with ordered list marker variant <- asks envVariant diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 2991e4ebca2c..5473fa813166 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -88,9 +88,13 @@ blockToMediaWiki :: PandocMonad m -> MediaWikiWriter m Text blockToMediaWiki (Div attrs bs) = do - contents <- blockListToMediaWiki bs - return $ render Nothing (tagWithAttrs "div" attrs) <> "\n\n" <> - contents <> "\n\n" <> "" + -- First try to unwrap wrapper divs + case unwrapWrapperDiv (Div attrs bs) of + Para inlines -> blockToMediaWiki (Para inlines) + _ -> do + contents <- blockListToMediaWiki bs + return $ render Nothing (tagWithAttrs "div" attrs) <> "\n\n" <> + contents <> "\n\n" <> "" blockToMediaWiki (Plain inlines) = inlineListToMediaWiki inlines diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 242cfaa462c7..74636dec4986 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -162,8 +162,10 @@ blockToMs opts (Div (ident,cls,kvs) bs) = do ".." $$ res _ -> do + -- Apply unwrapWrapperDiv to handle wrapper divs + let unwrappedBlocks = map unwrapWrapperDiv bs setFirstPara - res <- blockListToMs opts bs + res <- blockListToMs opts unwrappedBlocks setFirstPara return $ anchor $$ res blockToMs opts (Plain inlines) = diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 47a5e55ad5cb..b828351c7a49 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -281,7 +281,12 @@ blockToMuse (Table _ blkCapt specs thead@(TableHead hattr hrows) tbody tfoot) = numcols = maximum (length aligns :| length widths : map length (headers:rows)) isSimple = onlySimpleTableCells (headers : rows) && all (== 0) widths -blockToMuse (Div _ bs) = flatBlockListToMuse bs +blockToMuse (Div attr bs) = + case unwrapWrapperDiv (Div attr bs) of + Para inlines -> do + contents <- inlineListToMuse' inlines + return $ contents <> blankline + _ -> flatBlockListToMuse bs blockToMuse (Figure attr capt body) = do blockToMuse (figureDiv attr capt body) diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 80fdb41776d3..e0ca83933f0a 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -247,18 +247,20 @@ writeOpenDocument opts (Pandoc meta blocks) = do (B.divWith ("",[],[("custom-style","Abstract")]) (B.fromList xs)) meta + -- Apply unwrapWrapperDiv to all blocks + let blocks' = walk unwrapWrapperDiv blocks ((body, metadata),s) <- flip runStateT defaultWriterState $ do let collectBlockIdent (Header _ (ident,_,_) _) = [(ident,HeaderRef)] collectBlockIdent (Figure (ident,_,_) _ _ ) = [(ident,FigureRef)] collectBlockIdent (Table (ident,_,_) _ _ _ _ _) = [(ident,TableRef)] collectBlockIdent _ = [] - modify $ \s -> s{ stIdentTypes = query collectBlockIdent blocks } + modify $ \s -> s{ stIdentTypes = query collectBlockIdent blocks' } m <- metaToContext opts (inlinesToOpenDocument opts . blocksToInlines) (fmap chomp . inlinesToOpenDocument opts) meta' - b <- blocksToOpenDocument opts blocks + b <- blocksToOpenDocument opts blocks' return (b, m) let styles = stTableStyles s ++ stParaStyles s ++ formulaStyles ++ map snd (sortBy (flip (comparing fst)) ( diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 0a1137744242..d3100cdd57f3 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -125,7 +125,9 @@ blockToOrg (Div attr@(ident,_,_) bs) = do -- Strip off bibliography if citations enabled if ident == "refs" && isEnabled Ext_citations opts then return mempty - else divToOrg attr bs + else case unwrapWrapperDiv (Div attr bs) of + Para inlines -> blockToOrg (Para inlines) + _ -> divToOrg attr bs blockToOrg (Plain inlines) = inlineListToOrg inlines blockToOrg (Para inlines) = do contents <- inlineListToOrg inlines diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index fb07d8810731..563ae26ac11f 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -59,7 +59,7 @@ import qualified Text.Pandoc.Shared as Shared -- so we don't overlap "Element" import Text.Pandoc.Shared (tshow) import Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks , lookupMetaString, toTableOfContents - , toLegacyTable) + , toLegacyTable, unwrapWrapperDiv) import qualified Data.Map as M import qualified Data.Set as S import Data.Maybe (maybeToList, fromMaybe, listToMaybe, isNothing) @@ -536,7 +536,9 @@ blockToParagraphs (Div (_, classes, _) blks) = let | hasNonIncremental -> Just InNonIncremental | otherwise -> Nothing addIncremental env = env { envInIncrementalDiv = incremental } - in local addIncremental (concatMapM blockToParagraphs blks) + -- Apply unwrapWrapperDiv to each block to handle wrapper divs + unwrappedBlks = map unwrapWrapperDiv blks + in local addIncremental (concatMapM blockToParagraphs unwrappedBlks) blockToParagraphs (Figure attr capt blks) = -- This never seems to be used: blockToParagraphs (Shared.figureDiv attr capt blks) blockToParagraphs hr@HorizontalRule = notRendered hr diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 76c8d6fd0b15..503e2ebdec10 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -244,28 +244,32 @@ blockToRST :: PandocMonad m blockToRST (Div ("",["title"],[]) _) = return empty -- this is generated by the rst reader and can safely be -- omitted when we're generating rst -blockToRST (Div (ident,classes,_kvs) bs) = do - contents <- blockListToRST bs - let admonitions = ["attention","caution","danger","error","hint", - "important","note","tip","warning","admonition"] - let admonition = case classes of - (cl:_) - | cl `elem` admonitions - -> ".. " <> literal cl <> "::" - cls -> ".. container::" <> space <> +blockToRST block@(Div (ident,classes,_kvs) bs) = do + -- Check if this is a wrapper div that should be unwrapped + case unwrapWrapperDiv block of + Para inlines -> blockToRST (Para inlines) + _ -> do + contents <- blockListToRST bs + let admonitions = ["attention","caution","danger","error","hint", + "important","note","tip","warning","admonition"] + let admonition = case classes of + (cl:_) + | cl `elem` admonitions + -> ".. " <> literal cl <> "::" + cls -> ".. container::" <> space <> literal (T.unwords (filter (/= "container") cls)) - -- if contents start with block quote, we need to insert - -- an empty comment to fix the indentation point (#10236) - let contents' = case bs of - BlockQuote{}:_-> ".." $+$ contents - _ -> contents - return $ blankline $$ - admonition $$ - (if T.null ident - then blankline - else " :name: " <> literal ident $$ blankline) $$ - nest 3 contents' $$ - blankline + -- if contents start with block quote, we need to insert + -- an empty comment to fix the indentation point (#10236) + let contents' = case bs of + BlockQuote{}:_-> ".." $+$ contents + _ -> contents + return $ blankline $$ + admonition $$ + (if T.null ident + then blankline + else " :name: " <> literal ident $$ blankline) $$ + nest 3 contents' $$ + blankline blockToRST (Plain inlines) = inlineListToRST inlines blockToRST (Para inlines) | LineBreak `elem` inlines = diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 4a8f1d577f9e..a94ee8a7e697 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -231,7 +231,7 @@ blockToRTF :: PandocMonad m -> Block -- ^ block to convert -> m Text blockToRTF indent alignment (Div _ bs) = - blocksToRTF indent alignment bs + blocksToRTF indent alignment (map unwrapWrapperDiv bs) blockToRTF indent alignment (Plain lst) = rtfCompact indent 0 alignment <$> inlinesToRTF lst blockToRTF indent alignment (Para lst) = diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index a24be9a13e66..d60512d871df 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -49,6 +49,7 @@ module Text.Pandoc.Writers.Shared ( , isOrderedListMarker , toTaskListItem , delimited + , unwrapWrapperDiv ) where import Safe (lastMay, maximumMay) @@ -842,3 +843,11 @@ delimited opener closer content = toList (Concat (Concat a b) c) = toList (Concat a (Concat b c)) toList (Concat a b) = a : toList b toList x = [x] + +-- | Unwrap a Div with wrapper="1" attribute containing a single Para. +-- This is used to handle HTML paragraphs with attributes that were +-- wrapped during parsing. +unwrapWrapperDiv :: Block -> Block +unwrapWrapperDiv (Div (_, _, kvs) [Para inlines]) + | Just "1" <- lookup "wrapper" kvs = Para inlines +unwrapWrapperDiv block = block diff --git a/src/Text/Pandoc/Writers/TEI.hs b/src/Text/Pandoc/Writers/TEI.hs index d341bfb70c6f..5097f717baa8 100644 --- a/src/Text/Pandoc/Writers/TEI.hs +++ b/src/Text/Pandoc/Writers/TEI.hs @@ -120,7 +120,7 @@ blockToTEI opts (Div attr@(_,"section":_,_) (Header lvl _ ils : xs)) = blockToTEI opts (Div attr [Para lst]) = do let attribs = idFromAttr opts attr inTags False "p" attribs <$> inlinesToTEI opts lst -blockToTEI opts (Div _ bs) = blocksToTEI opts $ map plainToPara bs +blockToTEI opts (Div _ bs) = blocksToTEI opts $ map (unwrapWrapperDiv . plainToPara) bs blockToTEI _ h@Header{} = do -- should not occur after makeSections, except inside lists/blockquotes report $ BlockNotRendered h diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index fa00dc675fa8..a4f388d2d9a3 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -153,7 +153,7 @@ blockToTexinfo :: PandocMonad m => Block -- ^ Block to convert -> TI m (Doc Text) -blockToTexinfo (Div _ bs) = blockListToTexinfo bs +blockToTexinfo (Div _ bs) = blockListToTexinfo (map unwrapWrapperDiv bs) blockToTexinfo (Plain lst) = inlineListToTexinfo lst diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index d2a72550169f..1ee88055f18a 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -100,11 +100,14 @@ blockToTextile :: PandocMonad m -> Block -- ^ Block element -> TW m Text -blockToTextile opts (Div attr bs) = do - let startTag = render Nothing $ tagWithAttrs "div" attr - let endTag = "" - contents <- blockListToTextile opts bs - return $ startTag <> "\n\n" <> contents <> "\n\n" <> endTag <> "\n" +blockToTextile opts (Div (ident, classes, kvs) bs) = do + if Just "1" == lookup "wrapper" kvs + then blockListToTextile opts bs + else do + let startTag = render Nothing $ tagWithAttrs "div" (ident, classes, kvs) + let endTag = "" + contents <- blockListToTextile opts bs + return $ startTag <> "\n\n" <> contents <> "\n\n" <> endTag <> "\n" blockToTextile opts (Plain inlines) = inlineListToTextile opts inlines diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs index 7fd7e1cf6914..bd2ef6cd840f 100644 --- a/src/Text/Pandoc/Writers/Typst.hs +++ b/src/Text/Pandoc/Writers/Typst.hs @@ -30,7 +30,7 @@ import qualified Data.Text as T import Control.Monad.State ( StateT, evalStateT, gets, modify ) import Text.Pandoc.Writers.Shared ( lookupMetaInlines, lookupMetaString, metaToContext, defField, resetField, - setupTranslations ) + setupTranslations, unwrapWrapperDiv ) import Text.Pandoc.Shared (isTightList, orderedListMarkers, tshow) import Text.Pandoc.Translations (Term(Abstract), translateTerm) import Text.Pandoc.Walk (query) @@ -352,21 +352,25 @@ blockToTypst block = $$ ")" $$ lab $$ blankline Div (ident,_,_) (Header lev ("",cls,kvs) ils:rest) -> blocksToTypst (Header lev (ident,cls,kvs) ils:rest) - Div (ident,_,kvs) blocks -> do - let lab = toLabel FreestandingLabel ident - let (typstAttrs,typstTextAttrs) = pickTypstAttrs kvs - -- Handle lang attribute for Div elements - let langAttrs = case lookup "lang" kvs of - Nothing -> [] - Just lang -> case parseLang lang of - Left _ -> [] - Right l -> [("lang", - tshow (langLanguage l))] - let allTypstTextAttrs = typstTextAttrs ++ langAttrs - contents <- blocksToTypst blocks - return $ "#block" <> toTypstPropsListParens typstAttrs <> "[" - $$ toTypstPoundSetText allTypstTextAttrs <> contents - $$ ("]" <+> lab) + Div (ident,cls,kvs) blocks -> do + -- First try to unwrap wrapper divs + case unwrapWrapperDiv (Div (ident,cls,kvs) blocks) of + Para inlines -> blockToTypst (Para inlines) + _ -> do + let lab = toLabel FreestandingLabel ident + let (typstAttrs,typstTextAttrs) = pickTypstAttrs kvs + -- Handle lang attribute for Div elements + let langAttrs = case lookup "lang" kvs of + Nothing -> [] + Just lang -> case parseLang lang of + Left _ -> [] + Right l -> [("lang", + tshow (langLanguage l))] + let allTypstTextAttrs = typstTextAttrs ++ langAttrs + contents <- blocksToTypst blocks + return $ "#block" <> toTypstPropsListParens typstAttrs <> "[" + $$ toTypstPoundSetText allTypstTextAttrs <> contents + $$ ("]" <+> lab) defListItemToTypst :: PandocMonad m => ([Inline], [[Block]]) -> TW m (Doc Text) defListItemToTypst (term, defns) = do diff --git a/src/Text/Pandoc/Writers/XWiki.hs b/src/Text/Pandoc/Writers/XWiki.hs index 5e533ac61096..14e25af8bd38 100644 --- a/src/Text/Pandoc/Writers/XWiki.hs +++ b/src/Text/Pandoc/Writers/XWiki.hs @@ -45,7 +45,7 @@ import Text.Pandoc.Shared import Text.Pandoc.URI import Text.Pandoc.Writers.MediaWiki (highlightingLangs) import Text.Pandoc.Templates (renderTemplate) -import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable) +import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable, unwrapWrapperDiv) import Text.DocLayout (render, literal) newtype WriterState = WriterState { @@ -83,7 +83,7 @@ genAnchor id' = if Text.null id' blockListToXWiki :: PandocMonad m => [Block] -> XWikiReader m Text blockListToXWiki blocks = - vcat <$> mapM blockToXWiki blocks + vcat <$> mapM blockToXWiki (map unwrapWrapperDiv blocks) blockToXWiki :: PandocMonad m => Block -> XWikiReader m Text diff --git a/src/Text/Pandoc/Writers/ZimWiki.hs b/src/Text/Pandoc/Writers/ZimWiki.hs index 8009b1d2faef..2a73a2884f02 100644 --- a/src/Text/Pandoc/Writers/ZimWiki.hs +++ b/src/Text/Pandoc/Writers/ZimWiki.hs @@ -35,7 +35,7 @@ import Text.Pandoc.Options (WrapOption (..), import Text.Pandoc.Shared (figureDiv, linesToPara, removeFormatting, trimr) import Text.Pandoc.URI (escapeURI, isURI) import Text.Pandoc.Templates (renderTemplate) -import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable) +import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable, unwrapWrapperDiv) data WriterState = WriterState { stIndent :: Text, -- Indent after the marker at the beginning of list items @@ -78,9 +78,12 @@ escapeText = T.replace "__" "''__''" . -- | Convert Pandoc block element to ZimWiki. blockToZimWiki :: PandocMonad m => WriterOptions -> Block -> ZW m Text -blockToZimWiki opts (Div _attrs bs) = do - contents <- blockListToZimWiki opts bs - return $ contents <> "\n" +blockToZimWiki opts divBlock@(Div _attrs bs) = do + case unwrapWrapperDiv divBlock of + Para inlines -> blockToZimWiki opts (Para inlines) + _ -> do + contents <- blockListToZimWiki opts bs + return $ contents <> "\n" blockToZimWiki opts (Plain inlines) = inlineListToZimWiki opts inlines diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index 95fdba726911..1342d082656f 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -16,13 +16,16 @@ htmlWithOpts opts = unpack . purely (writeHtml4String opts{ writerWrapText = Wra html :: (ToPandoc a) => a -> String html = htmlWithOpts def +htmlWithParaAttrs :: (ToPandoc a) => a -> String +htmlWithParaAttrs = htmlWithOpts def{ writerExtensions = enableExtension Ext_paragraph_attributes (writerExtensions def) } + htmlQTags :: (ToPandoc a) => a -> String htmlQTags = unpack . purely (writeHtml4String def{ writerWrapText = WrapNone, writerHtmlQTags = True }) . toPandoc -html5 :: (ToPandoc a) => a -> String -html5 = unpack . purely (writeHtml5String def{ writerWrapText = WrapNone }) . toPandoc +html5WithParaAttrs :: (ToPandoc a) => a -> String +html5WithParaAttrs = unpack . purely (writeHtml5String def{ writerWrapText = WrapNone, writerExtensions = enableExtension Ext_paragraph_attributes (writerExtensions def) }) . toPandoc {- "my test" =: X =?> Y @@ -212,30 +215,33 @@ tests = ] ] , testGroup "paragraph attributes" - [ "paragraph with id and class" =: - divWith ("mypara", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) - =?> "

This is a paragraph.

" - , "paragraph with id only" =: - divWith ("mypara", [], [("wrapper", "1")]) (para (text "This is a paragraph.")) - =?> "

This is a paragraph.

" - , "paragraph with class only" =: - divWith ("", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) - =?> "

This is a paragraph.

" - , "paragraph with multiple classes" =: - divWith ("", ["important", "urgent"], [("wrapper", "1")]) (para (text "This is a paragraph.")) - =?> "

This is a paragraph.

" - , test html5 "paragraph with key-value attributes" + [ test htmlWithParaAttrs "paragraph with id and class" $ + (divWith ("mypara", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) + , test htmlWithParaAttrs "paragraph with id only" $ + (divWith ("mypara", [], [("wrapper", "1")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) + , test htmlWithParaAttrs "paragraph with class only" $ + (divWith ("", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) + , test htmlWithParaAttrs "paragraph with multiple classes" $ + (divWith ("", ["important", "urgent"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) + , test html5WithParaAttrs "paragraph with key-value attributes" $ (divWith ("", [], [("wrapper", "1"), ("foo", "bar")]) (para (text "This is a paragraph.")) , "

This is a paragraph.

" :: String) , "paragraph without wrapper attribute" =: divWith ("mydiv", ["someclass"], []) (para (text "This is a div, not a p.")) =?> "
\n

This is a div, not a p.

\n
" - , "paragraph with wrapper and other attributes" =: - divWith ("mypara", ["important"], [("wrapper", "1"), ("data-value", "123")]) (para (text "This is a paragraph.")) - =?> "

This is a paragraph.

" - , "paragraph with wrapper and align" =: - divWith ("mypara", [], [("wrapper", "1"), ("align", "center")]) (para (text "Aligned paragraph.")) - =?> "

Aligned paragraph.

" + , test htmlWithParaAttrs "paragraph with wrapper and other attributes" $ + (divWith ("mypara", ["important"], [("wrapper", "1"), ("data-value", "123")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) + , test htmlWithParaAttrs "paragraph with wrapper and align" $ + (divWith ("mypara", [], [("wrapper", "1"), ("align", "center")]) (para (text "Aligned paragraph.")) + , "

Aligned paragraph.

" :: String) + , test html "paragraph with wrapper (extension disabled)" $ + (divWith ("mypara", ["important"], [("wrapper", "1")]) (para (text "This is a paragraph.")) + , "

This is a paragraph.

" :: String) ] ] where diff --git a/test/command/10768.md b/test/command/10768.md deleted file mode 100644 index fee0dc6d082d..000000000000 --- a/test/command/10768.md +++ /dev/null @@ -1,68 +0,0 @@ -``` -% pandoc -f html -t native -

This is a paragraph with attributes.

-^D -[ Div - ( "test" - , [ "foo" , "bar" ] - , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] - ) - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "with" - , Space - , Str "attributes." - ] - ] -] -``` - -``` -% pandoc -f native -t html -[ Div - ( "test" - , [ "foo" , "bar" ] - , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] - ) - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "with" - , Space - , Str "attributes." - ] - ] -] -^D -

This is a paragraph -with attributes.

-``` - -``` -% pandoc -f html -t html -

This is a paragraph with attributes.

-^D -

This is a paragraph -with attributes.

-``` - -``` -% pandoc -f html -t html5 -

This is a paragraph with attributes.

-^D -

This is a paragraph -with attributes.

-``` diff --git a/test/command/10768/asciidoc.md b/test/command/10768/asciidoc.md new file mode 100644 index 000000000000..37979814db7d --- /dev/null +++ b/test/command/10768/asciidoc.md @@ -0,0 +1,89 @@ +Test for AsciiDoc writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t asciidoc +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. + +``` + +Test for AsciiDoc writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t asciidoc +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. + +``` + +Test for AsciiDoc writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t asciidoc +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +[[test]] +First paragraph + +Second paragraph + +``` + +Test for AsciiDoc writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t asciidoc +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +[[test]] +Not a wrapper diff --git a/test/command/10768/basic.md b/test/command/10768/basic.md new file mode 100644 index 000000000000..922aa6d69403 --- /dev/null +++ b/test/command/10768/basic.md @@ -0,0 +1,196 @@ +% pandoc -f html -t native +

This is a paragraph with attributes.

+^D +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +``` + +``` +% pandoc -f native -t html+paragraph_attributes +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc -f html+paragraph_attributes -t html+paragraph_attributes +

This is a paragraph with attributes.

+^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc -f html+paragraph_attributes -t html5+paragraph_attributes +

This is a paragraph with attributes.

+^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc --list-extensions=html | grep paragraph_attributes +^D +-paragraph_attributes +``` + +``` +% pandoc --list-extensions=html5 | grep paragraph_attributes +^D +-paragraph_attributes +``` + +``` +% pandoc --list-extensions | grep paragraph_attributes +^D +=> 1 +``` + +``` +% pandoc --list-extensions=markdown | grep paragraph_attributes +^D +=> 1 +``` + +``` +% pandoc -f native -t html+paragraph_attributes +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc -f native -t html-paragraph_attributes +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph with attributes.

+``` + +``` +% pandoc -f native -t html5+paragraph_attributes +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph +with attributes.

+``` + +``` +% pandoc -f native -t html5-paragraph_attributes +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph with attributes.

diff --git a/test/command/10768/commonmark.md b/test/command/10768/commonmark.md new file mode 100644 index 000000000000..9a518b98fc2a --- /dev/null +++ b/test/command/10768/commonmark.md @@ -0,0 +1,92 @@ +Test for CommonMark writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t commonmark +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for CommonMark writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t commonmark +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for CommonMark writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t commonmark +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +
+ +First paragraph + +Second paragraph + +
+``` + +Test for CommonMark writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t commonmark +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +
+ +Not a wrapper + +
diff --git a/test/command/10768/context.md b/test/command/10768/context.md new file mode 100644 index 000000000000..5cb14fce9ec2 --- /dev/null +++ b/test/command/10768/context.md @@ -0,0 +1,86 @@ +Test for ConTeXt writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t context +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for ConTeXt writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t context +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for ConTeXt writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t context +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +\reference[test]{}% +First paragraph + +Second paragraph +``` + +Test for ConTeXt writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t context +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +\reference[test]{}% +Not a wrapper diff --git a/test/command/10768/docbook.md b/test/command/10768/docbook.md new file mode 100644 index 000000000000..7055f733d8c3 --- /dev/null +++ b/test/command/10768/docbook.md @@ -0,0 +1,94 @@ +Test for DocBook writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t docbook +

This is a paragraph with attributes.

+^D + + This is a paragraph with attributes. + +``` + +Test for DocBook writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t docbook +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D + + This is a paragraph with attributes. + +``` + +Test for DocBook writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t docbook +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D + + + First paragraph + + + Second paragraph + +``` + +Test for DocBook writer - normal div without wrapper attribute should unwrap single block: + +``` +% pandoc -f native -t docbook +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D + + Not a wrapper + diff --git a/test/command/10768/docbook5.md b/test/command/10768/docbook5.md new file mode 100644 index 000000000000..d979d4f94685 --- /dev/null +++ b/test/command/10768/docbook5.md @@ -0,0 +1,94 @@ +Test for DocBook5 writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t docbook5 +

This is a paragraph with attributes.

+^D + + This is a paragraph with attributes. + +``` + +Test for DocBook5 writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t docbook5 +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D + + This is a paragraph with attributes. + +``` + +Test for DocBook5 writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t docbook5 +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D + + + First paragraph + + + Second paragraph + +``` + +Test for DocBook5 writer - normal div without wrapper attribute should unwrap single block: + +``` +% pandoc -f native -t docbook5 +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D + + Not a wrapper + diff --git a/test/command/10768/docx.md b/test/command/10768/docx.md new file mode 100644 index 000000000000..7e9c07d7747b --- /dev/null +++ b/test/command/10768/docx.md @@ -0,0 +1,112 @@ +Test for DOCX writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t docx --print-default-data-file=reference.docx > /dev/null && pandoc -f html -t docx | pandoc -f docx -t native +

This is a paragraph with attributes.

+^D +[ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] +] +``` + +Test for DOCX writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t docx --print-default-data-file=reference.docx > /dev/null && pandoc -f native -t docx | pandoc -f docx -t native +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +[ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] +] +``` + +Test for DOCX writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t docx --print-default-data-file=reference.docx > /dev/null && pandoc -f native -t docx | pandoc -f docx -t native +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +[ Para [ Str "First" , Space , Str "paragraph" ] +, Para [ Str "Second" , Space , Str "paragraph" ] +] +``` + +Test for DOCX writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t docx --print-default-data-file=reference.docx > /dev/null && pandoc -f native -t docx | pandoc -f docx -t native +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +[ Para + [ Str "Not" , Space , Str "a" , Space , Str "wrapper" ] +] diff --git a/test/command/10768/dokuwiki.md b/test/command/10768/dokuwiki.md new file mode 100644 index 000000000000..432607749bd9 --- /dev/null +++ b/test/command/10768/dokuwiki.md @@ -0,0 +1,91 @@ +Test for DokuWiki writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t dokuwiki +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. + + +``` + +Test for DokuWiki writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t dokuwiki +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. + + +``` + +Test for DokuWiki writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t dokuwiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First paragraph + +Second paragraph + + +``` + +Test for DokuWiki writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t dokuwiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +Not a wrapper + diff --git a/test/command/10768/epub.md b/test/command/10768/epub.md new file mode 100644 index 000000000000..4a4dd89710c3 --- /dev/null +++ b/test/command/10768/epub.md @@ -0,0 +1,57 @@ +Test for EPUB writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t epub3 --metadata title=Test -o /dev/null +

This is a paragraph with attributes.

+^D +``` + +Test for EPUB writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t epub3 --metadata title=Test -o /dev/null +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +``` + +Test for EPUB writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t epub3 --metadata title=Test -o /dev/null +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D diff --git a/test/command/10768/fb2.md b/test/command/10768/fb2.md new file mode 100644 index 000000000000..8c7ed73ec828 --- /dev/null +++ b/test/command/10768/fb2.md @@ -0,0 +1,86 @@ +Test for FB2 writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t fb2 +

This is a paragraph with attributes.

+^D + +unrecognisedpandoc<p />

This is a paragraph with attributes.

+``` + +Test for FB2 writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t fb2 +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D + +unrecognisedpandoc<p />

This is a paragraph with attributes.

+``` + +Test for FB2 writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t fb2 +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D + +unrecognisedpandoc<p />

First paragraph

Second paragraph

+``` + +Test for FB2 writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t fb2 +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D + +unrecognisedpandoc<p />

Not a wrapper

diff --git a/test/command/10768/haddock.md b/test/command/10768/haddock.md new file mode 100644 index 000000000000..2a20d336e236 --- /dev/null +++ b/test/command/10768/haddock.md @@ -0,0 +1,84 @@ +Test for Haddock writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t haddock +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for Haddock writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t haddock +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for Haddock writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t haddock +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First paragraph + +Second paragraph +``` + +Test for Haddock writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t haddock +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +Not a wrapper diff --git a/test/command/10768/html.md b/test/command/10768/html.md new file mode 100644 index 000000000000..533c7adc12de --- /dev/null +++ b/test/command/10768/html.md @@ -0,0 +1,82 @@ +% pandoc -f native -t html +[ Div + ( "" + , [] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "Normal" + , Space + , Str "paragraph" + ] + ] +] +^D +

Normal paragraph

+``` + +``` +% pandoc -f native -t html +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +
+

Not a wrapper

+
+``` + +Test for unwrapWrapperDiv function - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t html +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +
+

First paragraph

+

Second paragraph

+
+``` + +Test for unwrapWrapperDiv function - wrapper div with empty content: + +``` +% pandoc -f native -t html +[ Div + ( "" + , [] + , [ ( "wrapper" , "1" ) ] + ) + [] +] +^D +
+ +
diff --git a/test/command/10768/icml.md b/test/command/10768/icml.md new file mode 100644 index 000000000000..8d94557238b2 --- /dev/null +++ b/test/command/10768/icml.md @@ -0,0 +1,104 @@ +Test for ICML writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t icml +

This is a paragraph with attributes.

+^D + + + This is a paragraph with attributes. + + +``` + +Test for ICML writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t icml +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D + + + This is a paragraph with attributes. + + +``` + +Test for ICML writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t icml +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D + + + First paragraph + + +
+ + + Second paragraph + + +``` + +Test for ICML writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t icml +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D + + + Not a wrapper + + diff --git a/test/command/10768/jats.md b/test/command/10768/jats.md new file mode 100644 index 000000000000..97524f68201e --- /dev/null +++ b/test/command/10768/jats.md @@ -0,0 +1,87 @@ +Test for JATS writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t jats +

This is a paragraph with attributes.

+^D +

This is a paragraph with attributes.

+``` + +Test for JATS writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t jats +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph with attributes.

+``` + +Test for JATS writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t jats +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D + +

First paragraph

+

Second paragraph

+
+``` + +Test for JATS writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t jats +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D + +

Not a wrapper

+
diff --git a/test/command/10768/jira.md b/test/command/10768/jira.md new file mode 100644 index 000000000000..6ba3e3bef507 --- /dev/null +++ b/test/command/10768/jira.md @@ -0,0 +1,88 @@ +Test for Jira writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t jira +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for Jira writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t jira +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for Jira writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t jira +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +{panel:wrapper=1} +{anchor:test}First paragraph + +Second paragraph +{panel} +``` + +Test for Jira writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t jira +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +{panel:custom=value} +{anchor:test}Not a wrapper +{panel} diff --git a/test/command/10768/latex.md b/test/command/10768/latex.md new file mode 100644 index 000000000000..21e5b29ba729 --- /dev/null +++ b/test/command/10768/latex.md @@ -0,0 +1,86 @@ +Test for LaTeX writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t latex +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for LaTeX writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t latex +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for LaTeX writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t latex +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +\protect\phantomsection\label{test} +First paragraph + +Second paragraph +``` + +Test for LaTeX writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t latex +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +\protect\phantomsection\label{test} +Not a wrapper diff --git a/test/command/10768/man.md b/test/command/10768/man.md new file mode 100644 index 000000000000..9cbc46f92211 --- /dev/null +++ b/test/command/10768/man.md @@ -0,0 +1,88 @@ +Test for Man writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t man +

This is a paragraph with attributes.

+^D +.PP +This is a paragraph with attributes. +``` + +Test for Man writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t man +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +.PP +This is a paragraph with attributes. +``` + +Test for Man writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t man +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +.PP +First paragraph +.PP +Second paragraph +``` + +Test for Man writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t man +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +.PP +Not a wrapper diff --git a/test/command/10768/markdown.md b/test/command/10768/markdown.md new file mode 100644 index 000000000000..d93d1b5cc570 --- /dev/null +++ b/test/command/10768/markdown.md @@ -0,0 +1,88 @@ +Test for Markdown writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t markdown +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for Markdown writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t markdown +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for Markdown writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t markdown +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +::: {#test .foo wrapper="1"} +First paragraph + +Second paragraph +::: +``` + +Test for Markdown writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t markdown +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +::: {#test .foo custom="value"} +Not a wrapper +::: diff --git a/test/command/10768/mediawiki.md b/test/command/10768/mediawiki.md new file mode 100644 index 000000000000..92caf5b6c4d4 --- /dev/null +++ b/test/command/10768/mediawiki.md @@ -0,0 +1,95 @@ + +Test for MediaWiki writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t mediawiki +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for MediaWiki writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t mediawiki +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for MediaWiki writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t mediawiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +
+ +First paragraph + +Second paragraph + + +
+``` + +Test for MediaWiki writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t mediawiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +
+ +Not a wrapper + + +
diff --git a/test/command/10768/ms.md b/test/command/10768/ms.md new file mode 100644 index 000000000000..589815bd8269 --- /dev/null +++ b/test/command/10768/ms.md @@ -0,0 +1,88 @@ +Test for Ms writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t ms +

This is a paragraph with attributes.

+^D +.LP +This is a paragraph with attributes. +``` + +Test for Ms writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t ms +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +.LP +This is a paragraph with attributes. +``` + +Test for Ms writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t ms +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +.LP +First paragraph +.PP +Second paragraph +``` + +Test for Ms writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t ms +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +.LP +Not a wrapper diff --git a/test/command/10768/muse.md b/test/command/10768/muse.md new file mode 100644 index 000000000000..f6d5f6b960a5 --- /dev/null +++ b/test/command/10768/muse.md @@ -0,0 +1,87 @@ +Test for Muse writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t muse +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. + +``` + +Test for Muse writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t muse +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. + +``` + +Test for Muse writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t muse +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First paragraph + +Second paragraph + +``` + +Test for Muse writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t muse +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +Not a wrapper diff --git a/test/command/10768/odt.md b/test/command/10768/odt.md new file mode 100644 index 000000000000..3a590dfdd01f --- /dev/null +++ b/test/command/10768/odt.md @@ -0,0 +1,118 @@ +Test for ODT writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t odt --print-default-data-file=reference.odt > /dev/null && pandoc -f html -t odt | pandoc -f odt -t native +

This is a paragraph with attributes.

+^D +[ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] +] +``` + +Test for ODT writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t odt --print-default-data-file=reference.odt > /dev/null && pandoc -f native -t odt | pandoc -f odt -t native +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +[ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] +] +``` + +Test for ODT writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t odt --print-default-data-file=reference.odt > /dev/null && pandoc -f native -t odt | pandoc -f odt -t native +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +[ Div + ( "" , [] , [] ) + [ Para [ Str "First" , Space , Str "paragraph" ] + , Para [ Str "Second" , Space , Str "paragraph" ] + ] +] +``` + +Test for ODT writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t odt --print-default-data-file=reference.odt > /dev/null && pandoc -f native -t odt | pandoc -f odt -t native +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +[ Div + ( "" , [] , [] ) + [ Para + [ Str "Not" , Space , Str "a" , Space , Str "wrapper" ] + ] +] diff --git a/test/command/10768/opendocument.md b/test/command/10768/opendocument.md new file mode 100644 index 000000000000..8961a18af6d5 --- /dev/null +++ b/test/command/10768/opendocument.md @@ -0,0 +1,88 @@ +Test for OpenDocument writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t opendocument +

This is a paragraph with attributes.

+^D +This is a paragraph with +attributes. +``` + +Test for OpenDocument writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t opendocument +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with +attributes. +``` + +Test for OpenDocument writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t opendocument +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First +paragraph +Second +paragraph +``` + +Test for OpenDocument writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t opendocument +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +Not +a wrapper diff --git a/test/command/10768/org.md b/test/command/10768/org.md new file mode 100644 index 000000000000..afdc2ca6934a --- /dev/null +++ b/test/command/10768/org.md @@ -0,0 +1,88 @@ +Test for Org writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t org +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. + +``` + +Test for Org writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t org +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. + +``` + +Test for Org writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t org +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +<> +First paragraph + +Second paragraph +``` + +Test for Org writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t org +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +<> +Not a wrapper diff --git a/test/command/10768/plain.md b/test/command/10768/plain.md new file mode 100644 index 000000000000..9c18f5ac7f15 --- /dev/null +++ b/test/command/10768/plain.md @@ -0,0 +1,83 @@ +Test for Plain Text writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t plain +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for Plain Text writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t plain +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` +Test for Plain Text writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t plain +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First paragraph + +Second paragraph +``` + +Test for Plain Text writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t plain +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +Not a wrapper diff --git a/test/command/10768/powerpoint.md b/test/command/10768/powerpoint.md new file mode 100644 index 000000000000..bf73a6c52431 --- /dev/null +++ b/test/command/10768/powerpoint.md @@ -0,0 +1,78 @@ +Test for Powerpoint writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t pptx -o /dev/null +

This is a paragraph with attributes.

+^D +``` + +Test for Powerpoint writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t pptx -o /dev/null +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +``` + +Test for Powerpoint writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t pptx -o /dev/null +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +``` + +Test for Powerpoint writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t pptx -o /dev/null +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D diff --git a/test/command/10768/rst.md b/test/command/10768/rst.md new file mode 100644 index 000000000000..0abd21846138 --- /dev/null +++ b/test/command/10768/rst.md @@ -0,0 +1,90 @@ +Test for RST writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t rst +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for RST writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t rst +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for RST writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t rst +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +.. container:: foo + :name: test + + First paragraph + + Second paragraph +``` + +Test for RST writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t rst +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +.. container:: foo + :name: test + + Not a wrapper diff --git a/test/command/10768/rtf.md b/test/command/10768/rtf.md new file mode 100644 index 000000000000..bcd872f41b08 --- /dev/null +++ b/test/command/10768/rtf.md @@ -0,0 +1,83 @@ +Test for RTF writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t rtf +

This is a paragraph with attributes.

+^D +{\pard \ql \f0 \sa180 \li0 \fi0 This is a paragraph with attributes.\par} +``` + +Test for RTF writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t rtf +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +{\pard \ql \f0 \sa180 \li0 \fi0 This is a paragraph with attributes.\par} +``` + +Test for RTF writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t rtf +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +{\pard \ql \f0 \sa180 \li0 \fi0 First paragraph\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Second paragraph\par} +``` + +Test for RTF writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t rtf +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +{\pard \ql \f0 \sa180 \li0 \fi0 Not a wrapper\par} diff --git a/test/command/10768/tei.md b/test/command/10768/tei.md new file mode 100644 index 000000000000..d921bcc73e4f --- /dev/null +++ b/test/command/10768/tei.md @@ -0,0 +1,83 @@ +Test for TEI writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t tei +

This is a paragraph with attributes.

+^D +

This is a paragraph with attributes.

+``` + +Test for TEI writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t tei +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +

This is a paragraph with attributes.

+``` + +Test for TEI writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t tei +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +

First paragraph

+

Second paragraph

+``` + +Test for TEI writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t tei +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +

Not a wrapper

diff --git a/test/command/10768/texinfo.md b/test/command/10768/texinfo.md new file mode 100644 index 000000000000..5110b4c30145 --- /dev/null +++ b/test/command/10768/texinfo.md @@ -0,0 +1,96 @@ +Test for Texinfo writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t texinfo +

This is a paragraph with attributes.

+^D +@node Top +@top Top + +This is a paragraph with attributes. +``` + +Test for Texinfo writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t texinfo +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +@node Top +@top Top + +This is a paragraph with attributes. +``` + +Test for Texinfo writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t texinfo +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +@node Top +@top Top + +First paragraph + +Second paragraph +``` + +Test for Texinfo writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t texinfo +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +@node Top +@top Top + +Not a wrapper diff --git a/test/command/10768/textile.md b/test/command/10768/textile.md new file mode 100644 index 000000000000..015778d8e965 --- /dev/null +++ b/test/command/10768/textile.md @@ -0,0 +1,89 @@ +Test for Textile writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t textile +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for Textile writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t textile +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for Textile writer - wrapper div with multiple blocks should be unwrapped: + +``` +% pandoc -f native -t textile +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First paragraph + +Second paragraph +``` + +Test for Textile writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t textile +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +
+ +Not a wrapper + + +
diff --git a/test/command/10768/typst.md b/test/command/10768/typst.md new file mode 100644 index 000000000000..9cf665b097ec --- /dev/null +++ b/test/command/10768/typst.md @@ -0,0 +1,92 @@ +Test for Typst writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t typst +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. + +``` + +Test for Typst writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t typst +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. + +``` + +Test for Typst writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t typst +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +#block[ +First paragraph + +Second paragraph + +] +``` + +Test for Typst writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t typst +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +#block[ +Not a wrapper + +] diff --git a/test/command/10768/xwiki.md b/test/command/10768/xwiki.md new file mode 100644 index 000000000000..d07d0d84711c --- /dev/null +++ b/test/command/10768/xwiki.md @@ -0,0 +1,87 @@ +Test for XWiki writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t xwiki +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. + +``` + +Test for XWiki writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t xwiki +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. + +``` + +Test for XWiki writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t xwiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +{{id name="test" /}}First paragraph + +Second paragraph + +``` + +Test for XWiki writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t xwiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +{{id name="test" /}}Not a wrapper diff --git a/test/command/10768/zimwiki.md b/test/command/10768/zimwiki.md new file mode 100644 index 000000000000..d5fce2a92283 --- /dev/null +++ b/test/command/10768/zimwiki.md @@ -0,0 +1,87 @@ +Test for ZimWiki writer - HTML with attributed paragraph should unwrap wrapper div: + +``` +% pandoc -f html -t zimwiki +

This is a paragraph with attributes.

+^D +This is a paragraph with attributes. +``` + +Test for ZimWiki writer - Native AST with wrapper div should unwrap to simple paragraph: + +``` +% pandoc -f native -t zimwiki +[ Div + ( "test" + , [ "foo" , "bar" ] + , [ ( "wrapper" , "1" ) , ( "custom" , "value" ) ] + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "attributes." + ] + ] +] +^D +This is a paragraph with attributes. +``` + +Test for ZimWiki writer - wrapper div with multiple blocks should not be unwrapped: + +``` +% pandoc -f native -t zimwiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "wrapper" , "1" ) ] + ) + [ Para + [ Str "First" + , Space + , Str "paragraph" + ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + ] + ] +] +^D +First paragraph + +Second paragraph + + +``` + +Test for ZimWiki writer - normal div without wrapper attribute should not be unwrapped: + +``` +% pandoc -f native -t zimwiki +[ Div + ( "test" + , [ "foo" ] + , [ ( "custom" , "value" ) ] + ) + [ Para + [ Str "Not" + , Space + , Str "a" + , Space + , Str "wrapper" + ] + ] +] +^D +Not a wrapper +