Treat tabs as spaces in ODT Reader. (#7185)

This commit is contained in:
niszet 2021-04-01 08:44:34 +09:00 committed by GitHub
parent fd0873c907
commit 40da6c402b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View file

@ -577,7 +577,10 @@ read_spaces = matchingElement NsText "s" (
read_line_break :: InlineMatcher read_line_break :: InlineMatcher
read_line_break = matchingElement NsText "line-break" read_line_break = matchingElement NsText "line-break"
$ returnV linebreak $ returnV linebreak
--
read_tab :: InlineMatcher
read_tab = matchingElement NsText "tab"
$ returnV space
-- --
read_span :: InlineMatcher read_span :: InlineMatcher
read_span = matchingElement NsText "span" read_span = matchingElement NsText "span"
@ -585,6 +588,7 @@ read_span = matchingElement NsText "span"
$ matchChildContent [ read_span $ matchChildContent [ read_span
, read_spaces , read_spaces
, read_line_break , read_line_break
, read_tab
, read_link , read_link
, read_note , read_note
, read_citation , read_citation
@ -604,6 +608,7 @@ read_paragraph = matchingElement NsText "p"
$ matchChildContent [ read_span $ matchChildContent [ read_span
, read_spaces , read_spaces
, read_line_break , read_line_break
, read_tab
, read_link , read_link
, read_note , read_note
, read_citation , read_citation
@ -630,6 +635,7 @@ read_header = matchingElement NsText "h"
children <- ( matchChildContent [ read_span children <- ( matchChildContent [ read_span
, read_spaces , read_spaces
, read_line_break , read_line_break
, read_tab
, read_link , read_link
, read_note , read_note
, read_citation , read_citation

View file

@ -176,6 +176,7 @@ namesOfTestsComparingToNative = [ "blockquote"
, "referenceToText" , "referenceToText"
, "simpleTable" , "simpleTable"
, "simpleTableWithCaption" , "simpleTableWithCaption"
, "tab"
-- , "table" -- , "table"
, "textMixedStyles" , "textMixedStyles"
, "tableWithContents" , "tableWithContents"

View file

@ -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."]]

BIN
test/odt/odt/tab.odt Normal file

Binary file not shown.