sillsdev / docu-notion

Download Notion pages as markdown and image files, preserving hierarchy and enabling workflow properties. Works with Docusaurus.
MIT License
159 stars 30 forks source link

Toggle Items are rendered with </li> and <ul> tag. #77

Closed enfycius closed 1 year ago

enfycius commented 1 year ago

As the title suggests and the following image is shown, toggle items are rendered with </li> and <ul> tag.

So, it is not deployed to the Github Pages.

스크린샷 2023-09-15 오후 3 25 28
andrew-polk commented 1 year ago

I'm not seeing that with just a basic toggle with some text. What is the full content of your toggle?

What version of docu-notion are you using? You could try the alpha to see if it helps.

enfycius commented 1 year ago

@andrew-polk Actually, I used the alpha version of docu-notion. (I haven't checked yet) Maybe I think that it will be an issue but for docusaurus itself not for docu-notion. If I have time, I'll try to describe these issues in more detail. Thanks.

enfycius commented 1 year ago

If you have time, I'd appreciate it if you could review a situation with what is shown in the following image in Notion.

스크린샷 2023-09-16 오후 10 31 05
hatton commented 1 year ago

toggle items are rendered with </li> and <ul> tag.

I have seen this. We need to produce a test case and report to notion-to-md

SyntaxError: C:\dev\docu-notion-sample-site\docs\Examples\Lists.md: Expected corresponding JSX closing tag for <details>. (34:0)
  32 | <details>
  33 | <summary>This is a toggle</summary>
> 34 | </li>
     | ^
  35 | </ul>
  36 | <p>{`The inside of a toggle`}</p>
  37 | </details>
hatton commented 1 year ago

No, I was wrong. The output from notion-to-md is fine, it's Docusaurus (or rather its MD-->HTML converter) that produces invalid HTML if the toggle follows a list.

- alpha
<details>
<summary>toggle me</summary>
inside plain text
</details>

Gives

<details>
    <summary>toggle me</summary>
    inside plain text
    </li>
    </ul>
</details>

But if you add a line after - alpha, then everything is fine:

- alpha

<details>
<summary>toggle me</summary>
inside plain text

</details>

with

<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true">
    <summary>toggle me</summary>
    <div>
        <div class="collapsibleContent_i85q">inside plain text</div>
     </div>
</details>

Perhaps the could be solved by notion-to-md, if proper markdown means we should be adding a new line after the end of the bulleted list?

hatton commented 1 year ago

In the meantime, the workaround is, in Notion, to add an extra paragraph in between lists and toggles.

enfycius commented 1 year ago

@hatton Oh very thanks. I checked too late. I'm sorry.