Incorrect markdown preview on url with parentheses #1570

Closed
opened 2018-06-10 15:54:39 +02:00 by ghost · 5 comments
ghost commented 2018-06-10 15:54:39 +02:00 (Migrated from github.com)

The Issue

The link in the markdown preview differs from published description when it's a parentheses in the url.

Steps to Reproduce

  1. Markdown text:
    capture1

  2. Markdown preview:
    capture2

Here it's linking to https://en.wikipedia.org/wiki/Flying_monkeys_(psychology, without the last parentheses in the link so it directs to the incorrect url.

  1. When published it renders correctly though:
    capture3

Expected Behaviour

The markdown preview shouldn't differ from how it will actually appear

System Configuration

  • LBRY Daemon version: 0.19.3
  • LBRY App version: 0.22.0-rc.9
  • LBRY Installation ID: 2XLeCW8MRiQYbQvU57s3aFVvvGFqymwMuBngLZTL9qWHNazFkSauVgyq6Hdib8ieqr
  • Operating system: Windows 10

Anything Else

Another little thing I discovered was that tables don't preview correctly if there nothing in the last cell:
capture4

It should still be grey. It shows up correctly though:
capture5

Not huge issues, just nitpicking.

## The Issue The link in the markdown preview differs from published description when it's a parentheses in the url. ### Steps to Reproduce 1. Markdown text: ![capture1](https://user-images.githubusercontent.com/34570404/41202049-71c2d692-6cbb-11e8-98c5-73203f489618.PNG) 2. Markdown preview: ![capture2](https://user-images.githubusercontent.com/34570404/41202051-76a15e22-6cbb-11e8-9941-bf9ace47a975.PNG) Here it's linking to https://en.wikipedia.org/wiki/Flying_monkeys_(psychology, without the last parentheses in the link so it directs to the incorrect url. 3. When published it renders correctly though: ![capture3](https://user-images.githubusercontent.com/34570404/41202052-799de6ae-6cbb-11e8-81cb-109943efd81b.PNG) ### Expected Behaviour The markdown preview shouldn't differ from how it will actually appear ## System Configuration - LBRY Daemon version: 0.19.3 - LBRY App version: 0.22.0-rc.9 - LBRY Installation ID: 2XLeCW8MRiQYbQvU57s3aFVvvGFqymwMuBngLZTL9qWHNazFkSauVgyq6Hdib8ieqr - Operating system: Windows 10 ## Anything Else Another little thing I discovered was that tables don't preview correctly if there nothing in the last cell: ![capture4](https://user-images.githubusercontent.com/34570404/41202185-4b8a38a6-6cbd-11e8-9ec3-2ff5898ea2f8.PNG) It should still be grey. It shows up correctly though: ![capture5](https://user-images.githubusercontent.com/34570404/41202187-4edaceee-6cbd-11e8-8582-0c4cb781078f.PNG) Not huge issues, just nitpicking.
kauffj commented 2018-06-10 16:37:11 +02:00 (Migrated from github.com)

Thanks @m160 - we like nitpicking

Thanks @m160 - we like nitpicking
btzr-io commented 2018-06-10 19:51:54 +02:00 (Migrated from github.com)

There is nothing we can do about the parenthesis bug:

It seems that CodeMirror handles the parsing correctly while editing. However, Marked is not parsing it correctly for previewing. Since we depend on this library for SimpleMDE, an issue would need to be submitted with their repository.
https://github.com/sparksuite/simplemde-markdown-editor/issues/528#issuecomment-282644890

There is nothing we can do about the parenthesis bug: > ### [Incorrect link parsing in preview mode #528](https://github.com/sparksuite/simplemde-markdown-editor/issues/528) > It seems that CodeMirror handles the parsing correctly while editing. However, Marked is not parsing it correctly for previewing. Since we depend on this library for SimpleMDE, an issue would need to be submitted with their repository. > https://github.com/sparksuite/simplemde-markdown-editor/issues/528#issuecomment-282644890
btzr-io commented 2018-06-10 19:57:56 +02:00 (Migrated from github.com)

Also that's not the only problem with links, here is a full list:
https://github.com/markedjs/marked/issues/984

Also that's not the only problem with links, here is a full list: https://github.com/markedjs/marked/issues/984
btzr-io commented 2018-06-10 20:10:33 +02:00 (Migrated from github.com)
Possible solution: https://github.com/RIP21/react-simplemde-editor/issues/47#issuecomment-396070490
tiger5226 commented 2018-06-11 04:27:09 +02:00 (Migrated from github.com)

solved and merged

solved and merged
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LBRYCommunity/lbry-desktop#1570
No description provided.