Use marked instead of roaster + update marked #1161
Conversation
This package is deprecated
If true, add <br> on a single line break (copies GitHub behavior on comments, but not on rendered markdown files). Requires gfm be true.
@UziTech You are one of the main "marked" developers. It would be nice if you review this! GitHub does not break line in a single line anymore. Should we update the failing test? |
Github does support single line breaks on comments but not on readmes. I would do the same thing here. Enable line breaks for descriptions but not on the readme content. I noticed that marked is being used in an asynchronous way, but since marked doesn't need to connect to the file system or database it still just runs on the main thread, which can be bad for performance and lead to ReDos attacks. We should run marked in a worker or Task wherever we want it to be off the main thread. |
To follow GitHub's behavior
Does this mean what you are suggesting?
We need to merge atom/atom#21139 to be able to use WebWorkers. I think Task would be expensive here as it would start a new fork for every rendering. After we merge atom/atom#21139, we can definitely use WebWorkers for this. |
yes
I agree we should wait for web workers |
It looks like the tests fail because the renderer is removing html but the test expects The solution would be to not allow all html or update the renderer to allow |
I added renderer.html = (src) => {
const match = src.match(/<br\/>/);
if (match) {
return `<br/>`
}
return ''
} |
@sadick254 @darangi This is ready to go! 😃 All the tests pass. |
Co-authored-by: Tony Brix <tony@brix.ninja>
Description of the Change
This:
Benefits
Possible Drawbacks
N/A
Applicable Issues
Closes #1148
Fixes #500