emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] ox: fix comment exported as a blank line


From: Max Nikulin
Subject: Re: [PATCH] ox: fix comment exported as a blank line
Date: Wed, 1 Jun 2022 18:48:35 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 01/06/2022 12:30, Phil Estival wrote:

* lisp/ox.el (org-export--skip-p): no longer export single-line
comments as blank lines which did break paragraphs in two.

Phil, thank you for your attempt to improve handling of paragraph during export, there are enough various gotchas. Are the purpose of your patch the following?

#+begin_src elisp
  (org-export-string-as "Line 1.\n# comment\nLine 2." 'latex t)
#+end_src

#+RESULTS:
: Line 1.
: Line 2.

If so, unfortunately, you took a wrong direction, consider

#+begin_src elisp
  (org-export-string-as "Paragraph 1.\n# comment\nParagraph 2." 'html t)
#+end_src

#+RESULTS:
: <p>
: Paragraph 1.
: </p>
: <p>
: Paragraph 2.</p>

So there are still 2 separate paragraphs. It is necessary to either modify org-element parser or to apply a filter before passing AST to exporters. Last time it was discussed in

Ihor Radchenko. Merging paragraphs separated by comment lines during export (was: About 'inline special blocks') Thu, 26 May 2022 10:54:34 +0800. https://list.orgmode.org/875ylt6m1h.fsf@localhost

Notice that accordingly to
https://orgmode.org/worg/dev/org-syntax.html
comment (that is "element") can not be a part of a paragraph. So current behavior is intentional. In your next patch fixing a test "Para1" and "Para2" are meaningful names assuming paragraphs. If behavior is changed "Line1" and "Line2" should be less confusing.

If you are interested in other cases when org paragraph is not the same as exported LaTeX one, see the following thread:

Max Nikulin. Comments break up a paragraph when writing one-setence-per-line. Sun, 3 Oct 2021 18:34:10 +0700. https://list.orgmode.org/sjc4fk$76r$1@ciao.gmane.io



reply via email to

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