logseq / mldoc

Another Emacs Org-mode and Markdown parser.
GNU Affero General Public License v3.0
236 stars 21 forks source link

markdown lists are rendered as headings #74

Closed bensu closed 3 years ago

bensu commented 3 years ago

When calling Mldoc.exporttoHtml on the following string

- first level
  - second level

with this config

{"toc":false,"heading_number":false,"keep_line_break":true,"format":"Markdown","heading_to_list":true}

the output is:

<!-- directives: [] -->
<div id="content">
  <h1 id="first_level">first level</h1>
  <h2 id="second_level">second level</h2>
</div>

The output is the same whether I pass heading_to_list as true or false.

I would've expected something using <ul> and <li> like the following instead:

<div id="content">
  <ul>
    <li id="first_level">first level</li>
    <ul>
      <li id="second_level">second level</li>
    </ul>
  </ul>
</div>
RCmerci commented 3 years ago

Yes, - text is treated as a heading in logseq, and + text, * text are treated as list items. Maybe we should add an option to export it as <li> item when Mldoc.exporttoHtml later.

bensu commented 3 years ago

Thank you for the clarification! I solved this problem in this PR by using +:

https://github.com/logseq/logseq/pull/2367