emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-export: Remove zero-width space escapes during export


From: Max Nikulin
Subject: Re: [PATCH] org-export: Remove zero-width space escapes during export
Date: Tue, 26 Jul 2022 23:38:56 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 26/07/2022 19:59, Ihor Radchenko wrote:

This is a bug. While escape symbols do not affect export in most common
scenarios, your report is adding yet another case when zero-width space
is actually altering the export result.

I agree is zero-width space used as an escape character is too intrusive. It adds stray line breakpoints, it may be unwanted during copy&paste of text, especially if such text is code or a command.

I am attaching a tentative patch that will make Org export remove
zero-width spaces when those spaces actually separate the object
boundaries.

Any objections?

I think, you broke a valid use case when zero width space allows to wrap objects in the case of narrow page

[[unicorn-1.jpg]]​[[unicorn-2.jpg]]​[[unicorn-3.jpg]]​[[unicorn-4.jpg]]

It was briefly discussed, see
https://list.orgmode.org/874k7qboaq.fsf@nicolasgoaziou.fr/
Nicolas Goaziou. Re: Org-syntax: Intra-word markup. Fri, 03 Dec 2021 00:05:33 +0100

The idea was indeed inspired by Markdown.
However, Markdown is different - **bold** is the official syntax to
indicate bold markup.

Or by asciidoc https://list.orgmode.org/1ef0e093-c165-2a5f-954d-6a33b64c8ee9@mailbox.org/

+        (setq processed-string
+              (replace-regexp-in-string "\\`​" "" string))
+        (setq processed-string
+              (replace-regexp-in-string "​\\'" "" processed-string))

Please, use \u200B instead of the invisible character.
info "(elisp) Non-ASCII Characters in Strings"
https://www.gnu.org/software/emacs/manual/html_node/elisp/Non_002dASCII-in-Strings.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]