emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Exporting italic link with bang inside to html fails to parse the link [9.5.2 (N/A @ /gnu/store/89yvbijwnvsbpa5h33mvbgh1gy9w30n2-emacs-org-9.5.2/share/emacs/site-lisp/org-9.5.2/)]
Date: Sun, 01 May 2022 11:27:30 +0800	[thread overview]
Message-ID: <87czgy6ifx.fsf@localhost> (raw)
In-Reply-To: <t4jgta$q8e$1@ciao.gmane.io>

Max Nikulin <manikulin@gmail.com> writes:

>>> 2021-09-03  5:17 Dr. Arne Babenhauserheide Bug: PDF Export of Link fails
>>> https://list.orgmode.org/87pmtqp79s.fsf@web.de/T/#u
>>>
>>> Timothy suggested to fix `org-insert-link' somehow in than thread.
>> 
>> Yeah. I recall a number of bug report related to this behaviour.
>> Though I wanted to focus on org-insert-link here.
>
> Then the older bug may be cancelled as a duplicate.

Not sure. Even a fix to org-insert-link would not solve the problem with
unexpected export if the link is typed in manually. So, I'd rather keep
both the reports for the time being.

Or someone may go through all the related bugs and create a single giant
discussion to avoid scattering things around. In my notes, I have at
least 6 discussions related to edge cases of Org markup.

>>> Unfortunately It requires an additional export filter to remove zero
>>> width spaces.
>> 
>> Yeah. Right. It should even be an easy patch, which would be welcome :)
>
> I meant a custom user filter. I consider zero width spaces as the last 
> resort. Nicolas considered making zero width spaces an official part of 
> syntax stripped during export and a way to preserve some of them.

I think it is already kind of official. At least, we directly suggest
using zero width spaces in
https://orgmode.org/manual/Escape-Character.html#Escape-Character

The other thing is that ox.el does not do anything about zero width
spaces.

> In the case of links I still prefer breaking emphasis at the link
> borders. `org-insert-link' may check after inserting the markup if it
> is parsed as a link and add more markers if necessary.
> ...
>      /inter/[[https://orgmode.org/?oops=1][/word/]]/link/

I do not like this idea. It is fine when inserting a link into existing
emphasis, but what if an emphasis is applied around link later? We would
also need to update org-emphasize and still have an issue because many
users simply type the emphasis markers manually.

> I am afraid that zero width spaces in link targets may lead to confusion 
> of users since in the most cases e.g. http: URLs may be pasted to 
> external application as is.

We already escape '\' ,'[', and ']' in links. Zero width spaces will not
make things much different. Of course, org-link-escape and
org-link-unescape will need to be updated.

Note that even copying Urls directly can be worked around using
filter-buffer-substring-function.

Best,
Ihor



  reply	other threads:[~2022-05-01  3:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 10:18 [BUG] Exporting italic link with bang inside to html fails to parse the link [9.5.2 (N/A @ /gnu/store/89yvbijwnvsbpa5h33mvbgh1gy9w30n2-emacs-org-9.5.2/share/emacs/site-lisp/org-9.5.2/)] Dr. Arne Babenhauserheide
2022-04-30  9:37 ` Ihor Radchenko
2022-04-30 11:47   ` Max Nikulin
2022-04-30 12:34     ` Ihor Radchenko
2022-04-30 14:25       ` Max Nikulin
2022-05-01  3:27         ` Ihor Radchenko [this message]
2022-05-02 12:32           ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czgy6ifx.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).