emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to suppress extra newline between paragraphs in export?
@ 2016-04-18 16:30 Stig Brautaset
  2016-04-18 16:46 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Stig Brautaset @ 2016-04-18 16:30 UTC (permalink / raw)
  To: emacs-orgmode



Hello!

I've got a question I hope you might be able to answer. I'm trying to
add multi-paragraph item support to plain lists to my ox-jira.el
package. c.f. https://github.com/stig/ox-jira.el/issues/17

The issue I have is that I want to replace the blank line between
paragraphs in list items (which in JIRA ends the list and starts a new
paragraph) with the string =\\=. However, even when instrumenting
paragraph to check if its parent is an item (I'm being simplistic here)
there's a blank line I can't get at.

You can see it in an org document as simple as this, actually:

#+BEGIN_EXAMPLE
fi

fo
#+END_EXAMPLE

Then do =M-x pp-eval-expression RET (org-element-parse-buffer) RET=

The output is:

#+BEGIN_EXAMPLE
(org-data nil
          (section
           (:begin 1 :end 7 :contents-begin 1 :contents-end 7 :post-blank 0 :post-affiliated 1 :parent #0)
           (paragraph
            (:begin 1 :end 5 :contents-begin 1 :contents-end 4 :post-blank 1 :post-affiliated 1 :parent #1)
            #("fi\n" 0 3
              (:parent #2)))
           (paragraph
            (:begin 5 :end 7 :contents-begin 5 :contents-end 7 :post-blank 0 :post-affiliated 5 :parent #1)
            #("fo" 0 2
              (:parent #2)))))
#+END_EXAMPLE

However, if you actually generate the output (for ascii, for example) you get:

#+BEGIN_EXAMPLE
fi

fo
#+END_EXAMPLE

So there's an extra newline before =fo= that no transpose functions are
responsible for, as far as I can see. Is it possible to get at this
somehow?

Alternatively, do anyone have suggestions for how to support
multi-paragraph list items?

Stig

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to suppress extra newline between paragraphs in export?
  2016-04-18 16:30 how to suppress extra newline between paragraphs in export? Stig Brautaset
@ 2016-04-18 16:46 ` Nicolas Goaziou
  2016-04-19 22:23   ` Stig Brautaset
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2016-04-18 16:46 UTC (permalink / raw)
  To: Stig Brautaset; +Cc: emacs-orgmode

Hello,

Stig Brautaset <stig@brautaset.org> writes:


> I've got a question I hope you might be able to answer. I'm trying to
> add multi-paragraph item support to plain lists to my ox-jira.el
> package. c.f. https://github.com/stig/ox-jira.el/issues/17
>
> The issue I have is that I want to replace the blank line between
> paragraphs in list items (which in JIRA ends the list and starts a new
> paragraph) with the string =\\=. However, even when instrumenting
> paragraph to check if its parent is an item (I'm being simplistic here)
> there's a blank line I can't get at.
>
> You can see it in an org document as simple as this, actually:
>
> #+BEGIN_EXAMPLE
> fi
>
> fo
> #+END_EXAMPLE

[...]

>            (paragraph
>             (:begin 1 :end 5 :contents-begin 1 :contents-end 4 :post-blank 1 :post-affiliated 1 :parent #1)
                                                                            ^^^
                                                                          blank line

[...]

> So there's an extra newline before =fo= that no transpose functions are
> responsible for, as far as I can see. Is it possible to get at this
> somehow?

You can set the :post-blank value to 0 using a parse tree filter. See
for example `org-md-separate-elements'.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to suppress extra newline between paragraphs in export?
  2016-04-18 16:46 ` Nicolas Goaziou
@ 2016-04-19 22:23   ` Stig Brautaset
  0 siblings, 0 replies; 3+ messages in thread
From: Stig Brautaset @ 2016-04-19 22:23 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

[...]

>>            (paragraph
>>             (:begin 1 :end 5 :contents-begin 1 :contents-end 4 :post-blank 1 :post-affiliated 1 :parent #1)
>                                                                             ^^^
>                                                                           blank line
>
> [...]
>
>> So there's an extra newline before =fo= that no transpose functions are
>> responsible for, as far as I can see. Is it possible to get at this
>> somehow?
>
> You can set the :post-blank value to 0 using a parse tree filter. See
> for example `org-md-separate-elements'.

Perfect. That seems to be exactly what I'm after.

Stig

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-19 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 16:30 how to suppress extra newline between paragraphs in export? Stig Brautaset
2016-04-18 16:46 ` Nicolas Goaziou
2016-04-19 22:23   ` Stig Brautaset

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).