metanorma / metanorma-ogc

Metanorma processor for OGC documents
https://www.metanorma.com
BSD 2-Clause "Simplified" License
2 stars 3 forks source link

More link troubles with %20 and <- #676

Closed jerstlouis closed 1 month ago

jerstlouis commented 3 months ago

Both of these links work fine with asciidoctor-pdf:

https://maps.gnosis.earth/ogcapi/collections/gebco/dggs/isea3h/zones?filter=Elevation%20<%20-4000%20or%20Elevation>3000&zone-level=6&f=json[https://maps.gnosis.earth/ogcapi/collections/gebco/dggs/isea3h/zones?filter=Elevation < -4000 or Elevation > 3000&zone-level=6]

https://maps.gnosis.earth/ogcapi/collections/gebco/dggs/isea3h/zones?filter=Elevation<-4000%20or%20Elevation>3000&zone-level=6&f=json[https://maps.gnosis.earth/ogcapi/collections/gebco/dggs/isea3h/zones?filter=Elevation < -4000 or Elevation > 3000&zone-level=6]

In the HTML rendering, metanorma stops the link at the first %20 in the first and turns the <- in Elevation<-4000 into an arrow ().

How can we use that link?

Thanks!

jerstlouis commented 3 months ago

I figured how to make it work with "\https://..." inside the [ ], using the %20 outside the [ ].

Though it may still be interesting that these URLs worked fine with asciidoctor. (related to #664 and #671)

opoudjis commented 3 months ago

Lemme investigate why they work in Asciidoctor (eventually), it will lead to an editorial tip...

opoudjis commented 3 months ago

Added note from https://github.com/metanorma/metanorma-ogc/issues/664:

So I've verified this with the 3 links including CRS CURIEs that were causing problems, and this is what works for each of them:

https://maps.gnosis.earth/ogcapi/collections/blueMarble/map?center=0,51.5&scale-denominator=20000000&crs=%5BEPSG:4326%5D["\https://maps.gnosis.earth/ogcapi/collections/blueMarble/map?center=0,51.5&scale-denominator=20000000&crs=[EPSG:4326\]"]

https://maps.gnosis.earth/ogcapi/collections/blueMarble/map?center=0,51.5&scale-denominator=20000000&crs=%5BEPSG:3395%5D["\https://maps.gnosis.earth/ogcapi/collections/blueMarble/map?center=0,51.5&scale-denominator=20000000&crs=[EPSG:3395\]"]

https://maps.gnosis.earth/ogcapi/collections/blueMarble/map?bbox-crs=%5BEPSG:3395%5D&bbox=-4596385.263861,2080129.089271,4596385.263861,11273386.415933&crs=%5BEPSG:3395%5D["\https://maps.gnosis.earth/ogcapi/collections/blueMarble/map?bbox-crs=[EPSG:3395\]&bbox=-4596385.263861,2080129.089271,4596385.263861,11273386.415933&crs=[EPSG:3395\]"]

For the last one, the text is cut-off in the PDF rendering as it doesn't get a line-break, which is somewhat problematic:

cutOffLink

Note that these escaping backslashes render as actual backslashes in the displayed text when using asciidoctor-pdf, so this syntax / behavior is different in metanorma than plain ASCIIDoc -- is that expected?

To summarize just how incredibly difficult it is to encode such links including CURIEs:

opoudjis commented 1 month ago

Fixed in https://github.com/metanorma/metanorma-ogc/issues/671 : the additional requirements of \ escaping was introduced in Metanorma when we started treating links as passthroughs to prevent substitutions, and that was resulting in the link text then being identified as the hyperlink instead. Dealing programmatically now with escaping link text instead,