diff options
| author | Amir Dekel <6893125+adql@users.noreply.github.com> | 2022-10-10 12:20:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-10 12:20:58 +0200 |
| commit | 31aa660e656dc826e5c66927f645e3854194742d (patch) | |
| tree | 7d0337f68fee61318d691174658ae343494d3328 /test/Tests | |
| parent | 8f4308f2e575a5251c7b3e5091bb6e1392091d2f (diff) | |
Org reader: make #+pandoc-emphasis-pre work as expected. (#8360)
So far, `orgStateLastPreCharPos` wasn't updated appropriately after each
parsing to native Str (by the parser `str`). In addition to solving
this, the guard `notAfterString` in `emphasisStart` is removed to allow
emphasis after Str at the first place.
Diffstat (limited to 'test/Tests')
| -rw-r--r-- | test/Tests/Readers/Org/Inline.hs | 6 | ||||
| -rw-r--r-- | test/Tests/Readers/Org/Meta.hs | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/test/Tests/Readers/Org/Inline.hs b/test/Tests/Readers/Org/Inline.hs index bec796972..e54b9c28c 100644 --- a/test/Tests/Readers/Org/Inline.hs +++ b/test/Tests/Readers/Org/Inline.hs @@ -104,8 +104,10 @@ tests = "[fn::Schreib mir eine E-Mail]" =?> para (note $ para "Schreib mir eine E-Mail") - , "Markup-chars not occurring on word break are symbols" =: - T.unlines [ "this+that+ +so+on" + , "By default, markup-chars not occurring on word break are symbols" =: + T.unlines [ "#+pandoc-emphasis-pre:" + , "#+pandoc-emphasis-post:" + , "this+that+ +so+on" , "seven*eight* nine*" , "+not+funny+" ] =?> diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs index cce3f7a06..7ef8fe75d 100644 --- a/test/Tests/Readers/Org/Meta.hs +++ b/test/Tests/Readers/Org/Meta.hs @@ -208,12 +208,19 @@ tests = ] , testGroup "emphasis config" - [ "Changing pre and post chars for emphasis" =: - T.unlines [ "#+pandoc-emphasis-pre: \"[)\"" - , "#+pandoc-emphasis-post: \"]\\n\"" - , "([/emph/])*foo*" + [ "Changing pre chars for emphasis" =: + T.unlines [ "#+pandoc-emphasis-pre: \"[)$a1%\"" + , "[/emph/.)*strong*.a~code~" ] =?> - para ("([" <> emph "emph" <> "])" <> strong "foo") + para ("[" <> emph "emph" <> ".)" <> strong "strong" <> + ".a" <> code "code") + + , "Changing post chars for emphasis" =: + T.unlines [ "#+pandoc-emphasis-post: \"(]$a1%\"" + , "/emph/('*strong*]'~code~a" + ] =?> + para (emph "emph" <> "('" <> strong "strong" <> "]'" <> + code "code" <> "a") , "setting an invalid value restores the default" =: T.unlines [ "#+pandoc-emphasis-pre: \"[\"" |
