From de5620b04df540d11efdf96fb142b63b5ec4d3c5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 30 Jul 2022 11:27:14 +0200 Subject: [PATCH] Add tests for zero-width and fullwidth chars in grid tables --- test/markdown-reader-more.native | 142 +++++++++++++++++++++++++++++++ test/markdown-reader-more.txt | 20 +++++ 2 files changed, 162 insertions(+) diff --git a/test/markdown-reader-more.native b/test/markdown-reader-more.native index 7c15f627a..82b3577be 100644 --- a/test/markdown-reader-more.native +++ b/test/markdown-reader-more.native @@ -1089,6 +1089,148 @@ Pandoc ] ] (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "East" + , Space + , Str "Asian" + , Space + , Str "characters" + , Space + , Str "have" + , Space + , Str "double" + , Space + , Str "width" + ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 4.1666666666666664e-2 ) + , ( AlignDefault , ColWidth 6.944444444444445e-2 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\39770" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "fish" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Zero-width" + , Space + , Str "space" + , Space + , Str "in" + , Space + , Str "German" + ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.1111111111111111 ) + , ( AlignDefault , ColWidth 0.1111111111111111 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "German" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "English" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Auf\8204lage" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "edition" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Zero-width" + , Space + , Str "non-joiner" + , Space + , Str "in" + , Space + , Str "Persian" + ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.1111111111111111 ) + , ( AlignDefault , ColWidth 0.1388888888888889 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "\1605\1740\8204\1582\1608\1575\1607\1605" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + ] + ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) , Para [ Str "Empty" , Space , Str "cells" ] , Table ( "" , [] , [] ) diff --git a/test/markdown-reader-more.txt b/test/markdown-reader-more.txt index 0480e41cc..c6f313b20 100644 --- a/test/markdown-reader-more.txt +++ b/test/markdown-reader-more.txt @@ -260,6 +260,26 @@ Multiple blocks in a cell | r1 bis | - b 2 | c 2 | +------------------+-----------+------------+ +East Asian characters have double width + ++--+----+ +|魚|fish| ++--+----+ + +Zero-width space in German + ++-------+-------+ +|German |English| ++-------+-------+ +|Auf‌lage|edition| ++-------+-------+ + +Zero-width non-joiner in Persian + ++-------+---------+ +|می‌خواهم|I want to| ++-------+---------+ + Empty cells +---+---+