-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown (preview) mode lists problem #676
Comments
I believe it was rendered as a heading. The single
or Heading 2
------------- Both render as Heading 2A possible fix would be to catch a single |
There is a related issue with how Markdown lists are rendered in the Electron app. Lists that don't include a line space between the text immediately before the bullet points, and the bullet points themselves, are still rendered as formatted lists. For example, this list shouldn't render correctly because there is no line space before the bullet points: Instead, it does: |
The numbering issue reported by djordjeandrejevic affects me too and has caused me to use bullets instead of numbers to avoid this. It happens without fail when I have some preformatted text within the list like this:
Try it in Simplenote 1.1.7 on Ubuntu 18.04 and the last item renders with a number 1. |
Fixes: #676 The numbering of ol lists is currently broken when you have a list that is interrupted with a line of text that is not part of the list. This PR whitelists the start attribute on ol tags which fixes the issue. For example: 1. One 1. Two 1. Three some_text some_text 1. Four The above example should number the list 1 to 4. It, however, orders the list 1 to 3 and then after the interrupt starts over at 1. The output from showdown, the markdown to html processor, is: <ol> <li>One</li> <li>Two</li> <li>Three</li> </ol> <p>some_text some_text</p> <ol start="4"> <li>Four</li> </ol> Notice the second ol has a start attribute <ol start="4">. When we pass the html into the sanitizeHtml function that attribute is stripped. This PR whitelists that attribute so it is not stripped.
Fixes: #676 When a list has a trailing `-` the markdown renderer (showdown) will make the previous list element an h2. Technically this is valid markdown and is doing what it should but this is usually not the intention of the user. Because we auto-add a `-` after a carriage return users run into this issue regularly. This issue is resolved by enabling the `smoothLivePreview` option in showdown. You can replicate this with the following markdown: ``` - test 1 - test 2 - test 3 - ``` Currently, this will output: ``` <ul> <li>test 1</li> <li>test 2</li> </ul> <h2 id="test3">- test 3</h2> ``` After the addition of the `smoothLivePreview` option it will return: ``` <ul> <li>test 1</li> <li>test 2</li> <li>test 3</li> - </ul> ```
Hi,
I've faced strange behavior while creating a lists in Simplenote 1.1.0. Wasn't sure if that's expected behavior for the markdown, but I tested it later in online markdown tools and they didn't act the same as Simplenote.
Steps to reproduce
What I expected
I expected consistently styled list without the bold parts.
What happened instead
Last list item turned into bold (maybe even heading?) and the last
-
character disappeared.OS version
Ubuntu 16.10
The text was updated successfully, but these errors were encountered: