diff options
| author | Daniel Kessler <[email protected]> | 2023-01-29 13:38:54 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-01-29 16:40:32 -0800 |
| commit | 9dbb75dacb26e8482f62fcfaeb7a48ff7b1d7f0e (patch) | |
| tree | 636fe0d8a8bfae81716a165b9878126c10a42205 /test | |
| parent | 5d3b61a048bf0101e780bf61faabeea21ef93f90 (diff) | |
ODT reader: fix blockquote indent detection
The ODT reader is supposed to detect blockquotes by checking a paragraph
style's indentation level. But it's broken for two reasons:
* The parser fails on non-integers. So "1in" will get read as 25mm, but
"1.0in" fails. By default, the Quotations style is "0.3937in".
* The reader doesn't check indentation levels of parent styles.
In my test documents, LibreOffice often creates child styles for
individual paragraphs, so it's important to check parents (ODT files
created by the Pandoc ODT writer don't have this issue though).
I added a new test "blockquote2" whose ODT file is generated directly
from the corresponding Markdown file with pandoc.
Fixes #3437.
Diffstat (limited to 'test')
| -rw-r--r-- | test/Tests/Readers/ODT.hs | 3 | ||||
| -rw-r--r-- | test/odt/markdown/blockquote2.md | 3 | ||||
| -rw-r--r-- | test/odt/odt/blockquote2.odt | bin | 0 -> 9024 bytes |
3 files changed, 5 insertions, 1 deletions
diff --git a/test/Tests/Readers/ODT.hs b/test/Tests/Readers/ODT.hs index 54b9818ec..b48dbe9a3 100644 --- a/test/Tests/Readers/ODT.hs +++ b/test/Tests/Readers/ODT.hs @@ -146,7 +146,8 @@ testMediaBag name odtFile = buildTest $ testMediaBagIO name odtFile namesOfTestsComparingToMarkdown :: [ String ] -namesOfTestsComparingToMarkdown = [ "bold" +namesOfTestsComparingToMarkdown = [ "blockquote2" + , "bold" -- , "citation" , "endnote" , "externalLink" diff --git a/test/odt/markdown/blockquote2.md b/test/odt/markdown/blockquote2.md new file mode 100644 index 000000000..0e666aa98 --- /dev/null +++ b/test/odt/markdown/blockquote2.md @@ -0,0 +1,3 @@ +Paragraph + +> A blockquote. diff --git a/test/odt/odt/blockquote2.odt b/test/odt/odt/blockquote2.odt Binary files differnew file mode 100644 index 000000000..b6c922d89 --- /dev/null +++ b/test/odt/odt/blockquote2.odt |
