[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Bug: Extra blank line in subitem list when exported to markdown
From: |
Denis Bitouzé |
Subject: |
Re: [O] Bug: Extra blank line in subitem list when exported to markdown [8.3.1 (8.3.1-103-g366dc4-elpa @ /home/bitouze/.emacs.d/elpa/org-20150907/)] |
Date: |
Wed, 16 Sep 2015 20:03:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Le 16/09/15 à 14h51, Nicolas Goaziou <address@hidden> a écrit :
> Denis Bitouzé <address@hidden> writes:
>
>> Well, please, don't trust me too quickly :) I must admit I'm very far
>> from a mardown expert: I'm only a very occasional user.
>
> I never use markdown myself. Between the two of us, you are de facto
> the expert.
;)
>> In fact, my suggestion was wrong: AFAICS, the last example doesn't give
>> the expected HTML result neither and the less bad solution for nested
>> lists in markdown seems to be:
>>
>> #+NAME: test.md
>> #+begin_src markdown
>> - Foo 1
>>
>> - Foo 2:
>>
>> - Foo 21
>> - Foo 22
>>
>> End of Foo 2 item.
>> #+end_src
>>
>> which is interpreted as (rather ugly):
>>
>> #+begin_src html
>> <ul>
>> <li>
>> <p>Foo 1:</p>
>> </li>
>> <li>
>> <p>Foo 2:</p>
>> <ul>
>> <li>Foo 21</li>
>> <li>Foo 22</li>
>> </ul>
>> <p>End of Foo 2 item.</p>
>> </li>
>> </ul>
>> #+end_src
>
> This is problematic. There is a rule in "ox-md" that contradicts what
> you are suggesting. From org-md-separate-elements's docstring:
>
> 2. In an item, remove any blank line before the very first
> paragraph and the next sub-list.
>
> As a consequence, we try hard to produce
>
> - Foo 2:
> - Foo 21
> - Foo 22
>
> instead of
>
> - Foo 2:
>
> - Foo 21
> - Foo 22
>
> which was the case in early versions of Markdown exporter. I guess we
> should produce the latter only when the sub-list is followed by another
> block element, e.g., "End of Foo 2 item".
>
> WDYT?
Indeed but maybe my usecase is too specific for consuming time on it...
>>> Also, what about other block types, e.g., which one is valid:
>>>
>>> - Foo 1
>>> - Foo 2:
>>> - Foo 21
>>> - Foo 22
>>>
>>> #+begin_example
>>> Some example
>>> #+end_example
>>>
>>> or
>>>
>>> - Foo 1
>>> - Foo 2:
>>> - Foo 21
>>> - Foo 22
>>> #+begin_example
>>> Some example
>>> #+end_example
>>
>> I'm not sure to understand what you have in mind: are these last two
>> examples at org mode level?
>
> I'm trying to generalize the rule. Your previous suggestion applied to
> paragraphs. I wondered if it was the same with other block types, e.g.,
> example blocks.
Indeed, this a problem as the Markdown export will put "Some example" on
a separate line as well.
Maybe other more experienced Markdown users could help.
Regards,
--
Denis