Max Nikulin writes: >> I do not think that we need to handle this Org mode-wide (it will be >> difficult and will likely cause breaking changes). > > I have not figured out why it may become a breaking changes and what > backends need blank lines inside paragraph. I would make stripping empty > lines default behavior with some option to disable this feature. For example, consider an HTML exporter that aligns tags nicely and keeps blank lines between markup blocks for readability. If we remove such blank lines unconditionally, it will be problematic. >> See the attached tentative fix. > > Since zero width spaces are part of Org syntax, they need special treatment. They are not a part of Org syntax, and we currently do not handle them specially. They still work as escape-character simply because Org syntax defines markup boundaries using a closed set of whitespace characters - (rx (any " \t")). So, any non-tab non-space whitespace will be an equivalent of zero-width space for all practical purposes. > ---- 8< ---- > #+macro: empty (eval "") > > Some *bold*​@@comment: *@@ text. > @@comment: line@@ > More /italic/​{{{empty}}} text. > {{{empty}}} > Last line. > ---- >8 ---- > > LaTeX export: > ---- 8< ---- > Some \textbf{bold}​text. > More \emph{italic}​ text. > > Last line. > ---- >8 ---- > > Notice visible space character disappeared after "bold". I guess that I can change the condition to not include trailing space from (rx whitespace eol) to (rx (any " \t|) eol). See the attached updated version of the patch set. > ... I am leaving up > to you to decide if empty line appeared due to a macro is a bug or a > feature. If I remember it correctly, your opinion is that a macro > expanding to multiple paragraphs is a valid one. Yes. I do believe that we should keep macros as dumb as possible, so that people can use them in the most flexible ways, including breaking paragraphs, if so desired. A more annoying one is First line @@comment:foo@@ last line. vs. First line @@comment:foo @@last line. where we encounter the peculiarity of Org syntax with trailing tabs and spaces included as part of the object, but not newlines. But I do not see any good way to address this problem without rewriting half of Org mode.