aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniszet <niszet0016@gmail.com>2021-04-01 08:44:34 +0900
committerGitHub <noreply@github.com>2021-03-31 16:44:34 -0700
commit40da6c402beb64e47838254c04228098129165df (patch)
tree8342e7f54bfc33402634b3128ce6e95cbb2d3fd8
parentfd0873c907ea0bc1fee9ecbca5f2d05e29c5fe5b (diff)
downloadpandoc-40da6c402beb64e47838254c04228098129165df.tar.gz
Treat tabs as spaces in ODT Reader. (#7185)
-rw-r--r--src/Text/Pandoc/Readers/Odt/ContentReader.hs8
-rw-r--r--test/Tests/Readers/Odt.hs1
-rw-r--r--test/odt/native/tab.native1
-rw-r--r--test/odt/odt/tab.odtbin0 -> 10170 bytes
4 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
index df90880fa..c4220b0db 100644
--- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
@@ -577,7 +577,10 @@ read_spaces = matchingElement NsText "s" (
read_line_break :: InlineMatcher
read_line_break = matchingElement NsText "line-break"
$ returnV linebreak
-
+--
+read_tab :: InlineMatcher
+read_tab = matchingElement NsText "tab"
+ $ returnV space
--
read_span :: InlineMatcher
read_span = matchingElement NsText "span"
@@ -585,6 +588,7 @@ read_span = matchingElement NsText "span"
$ matchChildContent [ read_span
, read_spaces
, read_line_break
+ , read_tab
, read_link
, read_note
, read_citation
@@ -604,6 +608,7 @@ read_paragraph = matchingElement NsText "p"
$ matchChildContent [ read_span
, read_spaces
, read_line_break
+ , read_tab
, read_link
, read_note
, read_citation
@@ -630,6 +635,7 @@ read_header = matchingElement NsText "h"
children <- ( matchChildContent [ read_span
, read_spaces
, read_line_break
+ , read_tab
, read_link
, read_note
, read_citation
diff --git a/test/Tests/Readers/Odt.hs b/test/Tests/Readers/Odt.hs
index 9b5ec6b9e..edff4fe2c 100644
--- a/test/Tests/Readers/Odt.hs
+++ b/test/Tests/Readers/Odt.hs
@@ -176,6 +176,7 @@ namesOfTestsComparingToNative = [ "blockquote"
, "referenceToText"
, "simpleTable"
, "simpleTableWithCaption"
+ , "tab"
-- , "table"
, "textMixedStyles"
, "tableWithContents"
diff --git a/test/odt/native/tab.native b/test/odt/native/tab.native
new file mode 100644
index 000000000..948e81cd5
--- /dev/null
+++ b/test/odt/native/tab.native
@@ -0,0 +1 @@
+[Para [Str "Three",Space,Str "tabs",Space,Str "between",Space,Str "A",Space,Str "and",Space,Str "B",Space,Str "will",Space,Str "be",Space,Str "converted",Space,Str "to",Space,Str "one",Space,Str "Space:",Space,Str "A",Space,Str "B."]] \ No newline at end of file
diff --git a/test/odt/odt/tab.odt b/test/odt/odt/tab.odt
new file mode 100644
index 000000000..a2c80f45c
--- /dev/null
+++ b/test/odt/odt/tab.odt
Binary files differ