AsciiDoc writer: fix commas in link text.

Commas in link text trigger interpretation of attributes.
To block this, we replace them with numeric entities.

Closes #8070.
This commit is contained in:
John MacFarlane 2022-05-16 16:40:09 -07:00
parent 1906ae0548
commit 3df55b4a4a
2 changed files with 14 additions and 1 deletions

View file

@ -560,7 +560,8 @@ inlineToAsciiDoc opts (Link _ txt (src, _tit)) = do
-- relative: link:downloads/foo.zip[download foo.zip]
-- abs: http://google.cod[Google]
-- or my@email.com[email john]
linktext <- inlineListToAsciiDoc opts txt
let fixCommas = T.replace "," "&#44;" -- see #8070
linktext <- fmap fixCommas <$> inlineListToAsciiDoc opts txt
let isRelative = T.all (/= ':') src
let needsPassthrough = "--" `T.isInfixOf` src
let prefix = if isRelative

12
test/command/8070.md Normal file
View file

@ -0,0 +1,12 @@
```
% pandoc -f html -t asciidoc
<p><a href="https://docs.oracle.com/database/121/BRADV/rcmxplat.htm#BRADV724">12.1
manual&#44; Database Backup and Recovery User&#8217;s Guide:
<span class="enumeration_chapter">Chapter 28</span> Transporting Data Across Platforms&#44;
Steps to Transport a Database to a Different Platform Using Backup Sets</a></p>
^D
https://docs.oracle.com/database/121/BRADV/rcmxplat.htm#BRADV724[12.1
manual&#44; Database Backup and Recovery Users Guide:
[.enumeration_chapter]#Chapter 28# Transporting Data Across Platforms&#44;
Steps to Transport a Database to a Different Platform Using Backup Sets]
```