Closed urbite closed 1 month ago
The upstream markdown-it
editor shows the same behavior.
I'm not familiar with markdown-it. Is this a component in Joplin?
It is interesting that the same behavior is observed. Is there something in the markdown spec about what can or can't follow html?
Regarding the lack of a blank line between the end of the html table the markdown, this occurs in two places in one of my pages. I had a look at that page in OneNote and in both cases there is no line between the table and the heading.
Not stated previously in this issue, but I used OneNote Md Exporter to covert my OneNote notebook. Apparently the converter is correctly passing on the line spacing (or lack thereof) in the notebook.
I'm not familiar with markdown-it. Is this a component in Joplin?
markdown-it
is a JavaScript library for rendering Markdown to HTML. Joplin renders Markdown with an extended version of the markdown-it
library.
This issue on markdown-it
's GitHub repository may be relevant.
Edit: This seems to be the relevant part of the CommonMark spec:
[...]
- Start condition: line begins with the string < or </ followed by one of the strings (case-insensitive) address, article, aside, base, basefont, blockquote, body, caption, center, col, colgroup, dd, details, dialog, dir, div, dl, dt, fieldset, figcaption, figure, footer, form, frame, frameset, h1, h2, h3, h4, h5, h6, head, header, hr, html, iframe, legend, li, link, main, menu, menuitem, nav, noframes, ol, optgroup, option, p, param, search, section, summary, table, tbody, td, tfoot, th, thead, title, tr, track, ul, followed by a space, a tab, the end of the line, the string >, or the string />. End condition: line is followed by a blank line.
[...]
HTML blocks continue until they are closed by their appropriate end condition, or the last line of the document or other container block. This means any HTML within an HTML block that might otherwise be recognised as a start condition will be ignored by the parser and passed through as-is, without changing the parser’s state.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.
Operating system
Windows
Joplin version
Joplin 2.14.23
Desktop version info
Joplin 2.14.23 (prod, win32)
Client ID: cc3d6d3080164b5cbb264b01fa4efaef Sync Version: 3 Profile Version: 46 Keychain Supported: Yes
Revision: 7b6a19a
Backup: 1.4.0
Current behaviour
When HTML is immediately followed by markdown, the markdown is not rendered correctly. More specifically, the markdown is rendered as unformatted text. 'Immediately followed by' means on the next line, e.g. there is no blank line between the HTML and markdown code.
In this specific case, an HTML table is immediately followed by a heading tag. Here's a screen cap from Joplin, with subject area highlighted. It's interesting to note that the markdown is rendered correctly in the markdown editor but not in the final output!?
Simply adding a blank line between the end of the HTML and the markdown fixes the issue.
Expected behaviour
The expectation is that Joplin would correctly render the markdown following html code, even without a blank line separating the two. As a simple test I pasted the complete HTML table and markdown as posted above into the Typora app and it rendered correctly.
Typora source
Typora rendered
This can be reproduced by the following simple code block, with a blank html table
Logs
No response