João Pedro Medrado Sena <[email protected]> writes:

> I've been using the ox-extra package, specifically the ignore-headlines
> feature, to use headings as internal anchors/titles without displaying them
> in the final export.
>
> However, I noticed that when using the :ignore: tag, multiple sections are
> merged into a single paragraph in the exported file, regardless of line
> breaks.
>
> Example:
>
>     * Main heading
>     Here we have a text.
>
>     ** Section 1 :ignore:
>     Text here.
>
>     ** Section 2 :ignore:
>     More text.
>
> Actual result: All the text above appears as one continuous block.

Please keep in mind that org-contrib is only minimally maintained.
See https://git.sr.ht/~bzg/org-contrib/

> Suggested Fix: I found that commenting out the line (org-extra--merge-sections
> data backend info) resolves this and preserves the original paragraph
> structure. I'm not entirely sure if this line serves a specific purpose in
> other contexts, but removing it fixed the issue for my workflow.

The culprit is most likely because your example is structured as

(heading
 (section (:post-blank 1)
  (paragraph)))
(heading
 (section (:post-blank 1)
  (paragraph)))
(heading
 (section (:post-blank 1)
  (paragraph)))

When sections are merged, :post-blank is ignored, losing the blank lines.

Not merging the section works for you, but may break some exporters.
You should instead transfer :post-blank from the section to last element
inside before merging.
If you are willing to implement a patch to that effect, it would be welcome.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>

Reply via email to