Files
pandoc/test/docx/double_strikeout.native
TAKAHASHI, Kyohei abd4438d26 Docx reader: fix double strikethrough being dropped.
`w:dstrike` was not parsed at all, so text marked with Word's double
strikethrough was read as plain text, with no indication that it had
been struck out.

The other readers already treat a double line as a strikeout: the RTF
reader maps `\striked` and `\strikedl` just like `\strike`, and the
ODT reader accepts any `text-line-through-style` other than `none`.

`w:dstrike` gets its own field instead of being folded into
`isStrike`, because Word writes the two toggles independently and
they are inherited independently.  When a run overrides a character
style that has single strikethrough, Word writes
`<w:strike w:val="0"/><w:dstrike/>`; when a run cancels the double
strikethrough of such a style, it writes a bare
`<w:dstrike w:val="0"/>`.  A simple

    checkOnOff ns rPr (elemName ns "w" "strike") <|>
      checkOnOff ns rPr (elemName ns "w" "dstrike")

gets both of those wrong, and the added fixture covers them.  A run
with both toggles on yields a single `Strikeout`, not a nested one.

The fixture was created with Word 16.112.3 on macOS 26.6.2.
2026-10-05 20:19:20 -07:00

69 lines
1.3 KiB
Plaintext

Pandoc
Meta { unMeta = fromList [] }
[ Para
[ Str "This"
, Space
, Str "is"
, Space
, Strikeout [ Str "single" , Space , Str "strikethrough" ]
, Str ","
, Space
, Str "and"
, Space
, Str "this"
, Space
, Str "is"
, Space
, Strikeout [ Str "double" , Space , Str "strikethrough" ]
, Str "."
]
, Para
[ Str "A"
, Space
, Str "character"
, Space
, Str "style"
, Space
, Str "can"
, Space
, Strikeout
[ Str "strike" , Space , Str "this" , Space , Str "out," ]
, Space
, Str "cancel"
, Space
, Str "this,"
, Space
, Strikeout
[ Str "or"
, Space
, Str "strike"
, Space
, Str "this"
, Space
, Str "out"
, Space
, Str "twice"
]
, Str "."
]
, Para
[ Str "This"
, Space
, Str "is"
, Space
, Strikeout
[ Str "double-strikethrough,"
, Space
, Str "overridden"
, Space
, Str "to"
, Space
, Str "single,"
, Space
, Str "and"
]
, Space
, Str "cancelled."
]
]