diff options
| author | Albert Krewinkel <albert@zeitkraut.de> | 2022-06-06 16:12:45 +0200 |
|---|---|---|
| committer | Albert Krewinkel <albert@zeitkraut.de> | 2022-06-06 16:14:07 +0200 |
| commit | 78443004145adb85665cf799ccdfc115f64e47d1 (patch) | |
| tree | 0d88fea8282deaf9f9139bdbf7c9d7dea792da4a /test/Tests | |
| parent | 9d268e56ed85249b002b6afed4af944e9e89348d (diff) | |
Muse tests: do no try to roundtrip strings containing \DEL char
Fixes: #8108
Diffstat (limited to 'test/Tests')
| -rw-r--r-- | test/Tests/Readers/Muse.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 2cebaedf5..88b08242b 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -104,11 +104,20 @@ makeRoundTrip (OrderedList (start, LowerAlpha, _) items) = OrderedList (start, D makeRoundTrip (OrderedList (start, UpperAlpha, _) items) = OrderedList (start, Decimal, Period) items makeRoundTrip x = x +-- | Ensure an Inline element is representable in Muse. +-- +-- TODO: Check if string handling could be improved. +makeRoundTripInline :: Inline -> Inline +makeRoundTripInline (Str xs) = Str (T.replace "\DEL" "" xs) +makeRoundTripInline x = x + -- Demand that any AST produced by Muse reader and written by Muse writer can be read back exactly the same way. -- Currently we remove tables and compare first rewrite to the second. roundTrip :: Blocks -> Bool roundTrip b = d' == d'' - where d = walk makeRoundTrip $ Pandoc nullMeta $ toList b + where d = walk makeRoundTrip + . walk makeRoundTripInline + $ Pandoc nullMeta $ toList b d' = rewrite d d'' = rewrite d' rewrite = amuse . T.pack . (++ "\n") . T.unpack . |
