Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to prevent character autosubstitution in URIs #808

Closed
opoudjis opened this issue Aug 8, 2023 · 4 comments
Closed

Need to prevent character autosubstitution in URIs #808

opoudjis opened this issue Aug 8, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@opoudjis
Copy link
Contributor

opoudjis commented Aug 8, 2023

http://www.example.com/...text[] is auto-substituting to a smart ellipse (which is non-ascii). Need to prevent all such substitutions in URIs.

@opoudjis opoudjis added the bug Something isn't working label Aug 8, 2023
@opoudjis opoudjis self-assigned this Aug 8, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Aug 8, 2023
@opoudjis
Copy link
Contributor Author

opoudjis commented Aug 8, 2023

Even worse:

https://isotc.iso.org/livelink/livelink/fetch/2000/2122/15507012/20094274/ISO_Code_of_Conduct_-_Complaints_Handling_Guidance_Process_2020.pdf?nodeid=21068087&vernum=-2

is ending up as

https://isotc.iso.org/livelink/livelink/fetch/2000/2122/15507012/20094274/ISO_Code_of_Conduct_-<em>Complaints_Handling_Guidance_Process_2020.pdf?nodeid=21068087&vernum=-2

@opoudjis
Copy link
Contributor Author

opoudjis commented Aug 8, 2023

This is an Asciidoctor issue, and has been for a decade: asciidoctor/asciidoctor#61

https://docs.asciidoctor.org/asciidoc/latest/macros/complex-urls/ are the recommended workarounds. We are not realising the workarounds are even necessary, because the text is already processed with substitutions by the time the parser reveals the link text.

I'm going to preprocess the Asciidoctor text instead, disabling substitutions on identifiable links in the markup.

@opoudjis
Copy link
Contributor Author

opoudjis commented Aug 9, 2023

I've implemented the preprocessing, which realises the Asciidoctor workaround. I now need to restrict its application so it is not done wherever macros are not expanded (passthrough, sourcecode, stem, document header, etc.)

@opoudjis opoudjis closed this as completed Aug 9, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Metanorma Aug 9, 2023
opoudjis added a commit to metanorma/metanorma.org that referenced this issue Aug 15, 2023
@opoudjis
Copy link
Contributor Author

Also need to prevent link manipulation in attributes of blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant