Manually written HTML tags will not be output by Copy AS Simple HTML

バグ報告

Hello,

Right now, I’m writing HTML tags directly in the md document that don’t exist in markdown.

I want to export this document, but when I use As HTML and Copy As HTML, the tags I wrote (details~summary) come out properly, but when I use Copy As Simple HTML, the HTML tags I wrote directly (details~summary) don’t come out in the HTML document (clipboard).

There are no error messages in the console.

Is this a specification to make it simple?

利用環境

  • Platform: Windows
  • Platform version: 11 Pro 23H2
  • App Version: 5.8.1

再現方法

## title

<details>
  <summary>

### sub title
    
  </summary>

#### item1

12345
  
#### item2

* AAA

* BBB
  
</details>

File - Export - Copy As Simple HTML

<h2>title</h2>
<h3>sub title</h3>
<h4>item1</h4>
<p>12345</p>
<h4>item2</h4>
<ul>
  <li>
    <p>AAA</p>
  </li>
  <li>
    <p>BBB</p>
  </li>
</ul>

console - Elements

<details line-start="3" line-end="20" open="">
  <summary line-start="4" line-end="8">
<h3 line-start="6" line-end="6" id="sub-title">sub title</h3>
  </summary>
<h4 line-start="10" line-end="10" id="item1">item1</h4>
<p line-start="12" line-end="12">12345</p>
<h4 line-start="14" line-end="14" id="item2">item2</h4>
<ul line-start="16" line-end="18">
<li line-start="16" line-end="16">
<p line-start="16" line-end="16">AAA</p>
</li>
<li line-start="18" line-end="18">
<p line-start="18" line-end="18">BBB</p>
</li>
</ul>
</details>

Related to this, the edit window also seems to behave oddly.
If you use markdown syntax between directly embedded HTML tags (<details> ~ </details>), it doesn’t show up in the edit window.
Copy the code from your initial post and paste it into the edit window and try to reproduce the issue.
For example, writing ### between </details> and <details> works.

Hi @fuyuton ,

Thanks for the question.
Copy as Simple HTML does not allow raw HTML at the moment.
But I think it’s ok to allow it since you can assume that it’s not dangerous.
I will try enabling it in the next release.

That is intended. Raw HTML code is not allowed when converting from HTML to Markdown for security reasons.

Thank you for your reply.
I’ll wait for the next release.

@fuyuton Landed in Inkdrop Desktop v5.9.0-beta.2!

@craftzdog

The HTML output itself is normal. Thank you.

There was one thing that bothered me.

In inkdrop, when you write a bulleted or numbered list (outside of HTML tags), auto-completion works so that the next line will be the same.

However, when I tried to write a bulleted or numbered list inside an HTML tag, auto-completion did not work.

Also, I don’t know if this was the case in previous versions, but in 5.9.0beta2, if you used a numbered list outside of an HTML tag, the numbers were incremented and displayed in the editor.

(I installed the beta version over the previous version, so I can’t compare it right away. Sorry.)

If you want to use an MD heading tag within an HTML summary tag, press Enter after <summary> and type ### subtitle, and the MD tag will appear in VIEW as is, without any conversion.

The <details> and <summary> tags are treated as special in Markdown.
By design, the content of HTML tags is not parsed as Markdown:

<p>
  - list 1
  - list 2
</p>

Yields:

- list 1 - list 2


On the other hand, the content of <details> is parsed as Markdown:

<details>
  <summary>Summary</summary>

  - list 1
  - list 2
</details>

Yields:

Summary
  • list 1
  • list 2

Therefore, the editor basically expects the text inside an HTML tag to be HTML.
That’s why the continue-list doesn’t work here.
CodeMirror can’t know if it’s inside a details tag, unfortunately.

1 Like

I understand. Thank you.

My previous understanding was that HTML tags are ignored within the Markdown editor, meaning that Markdown tags can work within HTML tags.

I’ll revisit it when migrating to CM6!

2 Likes