rasendubi / uniorg

An accurate Org-mode parser for JavaScript/TypeScript
https://oleksii.shmalko.com/uniorg
GNU General Public License v3.0
263 stars 25 forks source link

Text inside definition list does not render correctly #15

Closed foo-dogsquared closed 3 years ago

foo-dogsquared commented 3 years ago

Reference

Description list items are unordered list items, and contain the separator ‘::’ to distinguish the description term from the description.

I've used the example from the examples folder as the setup. The description is rendering but the description term does not.

Example input:

- [[https://example.com][Example]] :: Hello there!
- [[https://github.com][GitHub]] :: This is GitHub, your hub for Git repos.
- *Gitlab* :: Alternative to GitHub
- /Sourcehut/ :: Another alternative to GitHub that primarily uses email-based workflows.
- /Codeberg/ :: *ANOTHER ALTERNATIVE*
- /*self-hosting Git server*/ :: /*The ultimate Git solution for privacy-oriented individuals!*/

Output (formatted to make it easier to read):

<dl>
  <dt>[[https://example.com][Example]]</dt><dd><p>Hello there!</p></dd>
  <dt>[[https://github.com][GitHub]]</dt><dd><p>This is GitHub, your hub for Git repos.</p></dd>
  <dt>*Gitlab*</dt><dd><p>Alternative to GitHub</p></dd>
  <dt>/Sourcehut/</dt><dd><p>Another alternative to GitHub that primarily uses email-based workflows.</p></dd>
  <dt>/Codeberg/</dt><dd><p><strong>ANOTHER ALTERNATIVE</strong></p></dd>
  <dt>/*self-hosting Git server*/</dt><dd><p><em><strong>The ultimate Git solution for privacy-oriented individuals!</strong></em></p></dd>
</dl>

The expected output (extracted from the HTML exporter from Emacs):

<dl>
  <dt><a href="https://example.com">Example</a></dt><dd>Hello there!</dd>
  <dt><a href="https://github.com">GitHub</a></dt><dd>This is GitHub, your hub for Git repos.</dd>
  <dt><b>Gitlab</b></dt><dd>Alternative to GitHub</dd>
  <dt><i>Sourcehut</i></dt><dd>Another alternative to GitHub that primarily uses email-based workflows.</dd>
  <dt><i>Codeberg</i></dt><dd><b>ANOTHER ALTERNATIVE</b></dd>
  <dt><i><b>self-hosting Git server</b></i></dt><dd><i><b>The ultimate Git solution for privacy-oriented individuals!</b></i></dd>
</dl>

It works with ordinary unordered lists so I figured this would be a bug.

rasendubi commented 3 years ago

Yeah, I noticed this before, however it matches how org-element.el parses the same input (it does not parse definition terms further), so I didn't fix it.

Though I didn't know that export to html parses terms further. Thanks for checking this!

I'll fix this issue when I'm back from vacation (next Monday)

On Mon, Jun 21, 2021, 06:49 Gabriel Arazas @.***> wrote:

Reference https://orgmode.org/manual/Plain-Lists.html#Plain-Lists

Description list items are unordered list items, and contain the separator ‘::’ to distinguish the description term from the description.

I've used the example from the examples folder as the setup. The description is rendering but the description term does not.

Example input:

  • [[https://example.com][Example]] :: Hello there!

  • [[https://github.com][GitHub]] :: This is GitHub, your hub for Git repos.

  • Gitlab :: Alternative to GitHub

  • /Sourcehut/ :: Another alternative to GitHub that primarily uses email-based workflows.

  • /Codeberg/ :: ANOTHER ALTERNATIVE

  • /self-hosting Git server/ :: /The ultimate Git solution for privacy-oriented individuals!/

Output (formatted to make it easier to read):

[[https://example.com][Example]]

Hello there!

[[https://github.com][GitHub]]

This is GitHub, your hub for Git repos.

*Gitlab*

Alternative to GitHub

/Sourcehut/

Another alternative to GitHub that primarily uses email-based workflows.

/Codeberg/

ANOTHER ALTERNATIVE

/*self-hosting Git server*/

The ultimate Git solution for privacy-oriented individuals!

The expected output (extracted from the HTML exporter from Emacs):

Example
Hello there!
GitHub
This is GitHub, your hub for Git repos.
Gitlab
Alternative to GitHub
Sourcehut
Another alternative to GitHub that primarily uses email-based workflows.
Codeberg
ANOTHER ALTERNATIVE
self-hosting Git server
The ultimate Git solution for privacy-oriented individuals!

It works with ordinary unordered lists so I figured this would be a bug.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rasendubi/uniorg/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKNTEYVT5C7UUSRX5P4QDTTT2SB7ANCNFSM47AWJGIQ .

rasendubi commented 3 years ago

Fixed in #16 and published as v0.3.0.