[IMPROVE] Upgrade Marked to 3.0.8 + fix linebreaks#23596
[IMPROVE] Upgrade Marked to 3.0.8 + fix linebreaks#23596Karting06 wants to merge 2 commits intoRocketChat:developfrom
Conversation
|
@ggazzo @dougfabris can we get this in a release soon? Would be awesome! |
|
@Karting06 Thanks a lot for your help. We discussed internally and we are planning to deprecate the marked in the future, replacing it with our own marked solution. Because of that we won't upgrade the |
|
Ok, thanks for the follow-up @dougfabris. |
|
Sorry @dougfabris to disturb you again. Do you really think it's good idea to "re-invent the wheel"? Why not use a framework that is known and well developed? You're just adding another component that you have to maintain yourselves. I think there are enough problems and bugs with self-developed stuff already and ever new release brings more problems than fixing.. IMHO this decision should be overthinked... |
|
@danel1 please, consider this answer about why we're implementing our own parser: #20234 (comment) |
Proposed changes (including videos or screenshots)
Issue(s)
Fixes: #11675 (line break issue)
Fixes: #11214 (emoji)
Closes: #20234
Closes: #23380
Steps to test or reproduce
See details for the line break issue : #11675
Further comments
The implementation of the Original Markdown in Rocket.Chat doesn't add a paragraph HTML tag to each message (
<p>message</p>) while Marked.js did. I changed the paragraph renderer to fix that. This also fixed the problem with ASCII emojis (:)) not being parsed by the emoji parser.Marked Markdown also parsed multiple line breaks as a new paragraph while Original Markdown doesn't. I slightly changed the paragraph rule of Marked Markdown (GFM & normal) in order to keep 1 paragraph. The line breaks are now consistent with Original Markdown.
Regarding the new Marked.js version:
The current version of Marked.js don't have separated
em&strongrules anymore instead they useemStrong.I couldn't migrate the custom
inlineLexerrules forstrong&em. I also don't really know where they are used in order to test it.