mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-23 16:05:54 +00:00
AsciiDoc writer: use doubled delims in more contexts.
Also escape the `#` character. Closes #11362. An alternative solution, raised in #11362, would be to rely less on escaping and simply always use doubled delimiters. However, there would still be a need for escaping, since one might use a literal `##` (for example)>
This commit is contained in:
@@ -163,6 +163,7 @@ escapeString context t
|
||||
needsEscape '+' = True
|
||||
needsEscape '`' = True
|
||||
needsEscape '*' = True
|
||||
needsEscape '#' = True
|
||||
needsEscape '_' = True
|
||||
needsEscape '<' = True
|
||||
needsEscape '>' = True
|
||||
@@ -593,7 +594,9 @@ inlineListToAsciiDoc opts lst = do
|
||||
_ -> False
|
||||
isSpacy Start (Str xs)
|
||||
| Just (c, _) <- T.uncons xs = isPunctuation c || isSpace c
|
||||
isSpacy _ _ = True
|
||||
isSpacy End (Link{}) = True
|
||||
isSpacy End (Image{}) = True
|
||||
isSpacy _ _ = False
|
||||
|
||||
setIntraword :: PandocMonad m => Bool -> ADW m ()
|
||||
setIntraword b = modify $ \st -> st{ intraword = b }
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
```
|
||||
% pandoc -f markdown -t asciidoc
|
||||
This is a _test_[^1].
|
||||
|
||||
And yet another **one**[^1].
|
||||
|
||||
We can also try to write #hashtags [this]{.test}.
|
||||
|
||||
[^1]: Test footnote.
|
||||
^D
|
||||
This is a __test__footnote:[Test footnote.].
|
||||
|
||||
And yet another **one**footnote:[Test footnote.].
|
||||
|
||||
We can also try to write ++#++hashtags [.test]#this#.
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user