Max Nikulin <maniku...@gmail.com> writes: > On 01/09/2023 16:04, Ihor Radchenko wrote: >> Max Nikulin writes: >> >>> However I do not mind to have an easy way to delegate URI from :export >>> function to the link transcoder of active export backend. > >> Just make the :export function return nil. > > I missed this feature, but anyway it does not work as expected. > > (org-link-set-parameters "tel") > > or > > (org-link-set-parameters > "tel" > :export (lambda (_path _descr _backend) nil)) > > strips link type and exports links as e.g. > > \href{321}{call} > > "tel:" is missed. Each backend has its own hardcoded list of blessed > link types to preserve link type/protocol/scheme: > - LaTeX: "http" "https" "ftp" "mailto" "doi" > - HTML: "http" "https" "ftp" "mailto" "news"
In `org-latex-link', (path (org-latex--protect-text (pcase type ((or "http" "https" "ftp" "mailto" "doi") (concat type ":" raw-path)) ("file" (org-export-file-uri raw-path)) (_ raw-path)))) is fishy. We may simply use (org-element-property :raw-link link) and leave special handling to "file" links only. Does it make sense? > Actually I had in mind more flexible delegation. :export functions > should be able to alter URI, attributes and to provide description if it > is missed, but did not care if '<a href=""></a>' or '\href{}{}' should > be used. I'd call that :filter rather than :export :) Have nothing against it, though it is not 100% relevant to this particular report. > Easy way to add protocol/scheme should include :follow with `browse-url' > as well. Sorry, but I do not understand what you are referring to. May you elaborate? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>