metanorma / metanorma-standoc

Metanorma for Standoc documents
BSD 2-Clause "Simplified" License
5 stars 2 forks source link

Quoted links not working #911

Closed opoudjis closed 1 month ago

opoudjis commented 1 month ago

New issue that I've detected randomly in NIST, and which will have been there for a while in the aftermath of the escaping of hyperlinks from substitution, https://github.com/metanorma/metanorma-standoc/issues/808

Quoted hyperlinks are not working:

"_http://cce.mitre.org_"

"http://cce.mitre.org"

are ending up as:

<p id="_8334a0df-7cdc-9cc2-76bf-f8ed8d81c440">“”<em><link target="http://cce.mitre.org"/></em></p>

<p id="_9ac95519-f186-1a03-a6cf-3f438961cdbc">“<link target="http://cce.mitre.org"/>”/&gt;</p>

Even with smartquotes off, there is a residual issue:

<p id="_98c2f6e5-fd2c-3d63-185c-1929a76270a0">"<em><link target="http://cce.mitre.org"/></em>"</p>

<p id="_11bb10df-4b5f-9292-840c-11a197065ee6">"<link target="http://cce.mitre.org"/>"/&gt;</p>
opoudjis commented 1 month ago

Escaping "http://www.example.com" is converting it to link:++http://cce.mitre.org"++[].

I have special processing for the escaping macro if links being escaped started with <. I need that for quotes and brackets as well.

opoudjis commented 1 month ago

“”<link/> was a different bug, handling "abc<tag/>" in smart quotes => "abc"<tag/>. We don't want that to apply to `"" in isolation.