ox-rst icon indicating copy to clipboard operation
ox-rst copied to clipboard

BEGIN_QUOTE is exported incorrectly

Open beetleb opened this issue 7 years ago • 8 comments

BEGIN_QUOTE is exported to a literal block.

In Org Mode, BEGIN_EXAMPLE corresponds to literal blocks, not BEGIN_QUOTE:

http://orgmode.org/manual/Literal-examples.html

BEGIN_QUOTE is just for indenting. The equivalent in rst is a quote block:

http://docutils.sourceforge.net/docs/user/rst/quickref.html#block-quotes

beetleb avatar Apr 24 '17 02:04 beetleb

Please try this:

#+ATTR_RST: :margin 4 #+BEGIN_QUOTE foo bar #+END_QUOTE

see README.org

I don't like to care about indentation of reST semantics in Org. The quote block in reST doesn't match a quote paragraph in Org. http://orgmode.org/manual/Paragraphs.html#Paragraphs

msnoigrs avatar Apr 24 '17 04:04 msnoigrs

I think what is troubling me is that when you export BEGIN_QUOTE with ox-rst, it maintains line wraps, which is not the usual behavior when exporting in Org mode (e.g. if I export to HTML). This is problematic for web display - I don't want to force line wraps on the user - it will look wrong depending on the resolution the user has set.

I think the idea of a quote is that we are quoting someone (different from BEGIN_VERSE where line wraps matter). So when exported, it needs to show up as different - the convention is an indent.

I'm not too concerned about having it indent. I just need it to show up as:

  1. Different from regular text.
  2. Not honor line wraps in the original org file.

beetleb avatar Apr 24 '17 13:04 beetleb

I means that the quote block of reST affected by indents in html.

For example:

Org:

#+BEGIN_QUOTE
line1
  line2
   line3 
#+END_QUOTE

exporting to reST:

    line1
      line2
       line3

rst2html exporting to

<blockquote>
<dl class="docutils">
<dt>line1</dt>
<dd><dl class="first last docutils">
<dt>line2</dt>
<dd>line3</dd>
</dl>
</dd>
</dl>
</blockquote>

msnoigrs avatar Apr 24 '17 14:04 msnoigrs

I understand, but how do I resolve the line wrap issue?

#+BEGIN_QUOTE Part of this sentence is wrapped in the middle. #+END_QUOTE

This should export to:

Part of this sentence is wrapped in the middle.

And not:

Part of this sentence
is wrapped in the middle.

The exporter should not preserve the line break unless there is a blank line in between.

beetleb avatar Apr 24 '17 14:04 beetleb

Ox-rst doesn't treat line breaks as other ox-* backends and leave it as it is.

I suppose that the bellow is the closest to your wish.

#+ATTR_RST: :margin 4
#+BEGIN_QUOTE
Part of this sentence
is wrapped in the middle.
#+END_QUOTE

export to:

    Part of this sentence
    is wrapped in the middle.

msnoigrs avatar Apr 24 '17 14:04 msnoigrs

OK. I think I was getting confused because, taking your example:

#+BEGIN_QUOTE
line1
  line2
    line3 
#+END_QUOTE

exports to

<blockquote> 
<p>
line1
  line2
   line3 
</p>
</blockquote>

But in HTML, the paragraph tag rendering ignores line breaks.

I think your solution works. I got a bit confused in the middle. Thanks!

beetleb avatar Apr 24 '17 14:04 beetleb

Hmm...I will continue to consider your suggestion. Because ox-ascii remove line breaks from quote block.

msnoigrs avatar Apr 24 '17 14:04 msnoigrs

Umm, OK, a little confused now.

If you do what you said here it should work - even with the line breaks. I noticed the resulting HTML does not have the line breaks. So that still works.

From an Org mode perspective, though, probably the default for BLOCK_QUOTE should be to indent, because that's what Org mode intended as written in their manual.

I do not see a need to explicitly remove line breaks. If you just change it to use rst indent (as in your comment, but without the need to explicitly specify an indent), it should work.

beetleb avatar Apr 25 '17 06:04 beetleb