Repository navigation
Allow Markdown in setting descriptions - #635
Conversation
|
There aren't any other specs for the Space Pen helpers in In the meantime, I'll continue trying. |
|
We definitely need to whitelist markup features; supporting headers, images, lists, HTML, and so forth, is a bad idea. It will be misused/abused. Off the top of my head, the only markup we should support is
Although, not having studied how marked's lexer tokenizes the input, using only content from the first |
|
It looks like overriding the renderer might be a good method of whitelisting things: We can just have the elements that we don't want to support emit nothing. I think supporting all the inline methods except images and none of the block methods to begin with would be fine. I'll extract the Markdown description stuff into a separate file to make it easy to spec. Then we can just call it from |
|
💥 Nice! |
Whitelisted only the following Markdown constructs: * **bold** * *italic* * `code spans` * line breaks `<br/>` * ~~strikethrough~~ * [links](http://www.example.com) Added specs
There was a problem hiding this comment.
From a purely aesthetic viewpoint, it might look a bit more tidy if all of these were collapsed to single lines;
renderer.code = -> ''
renderer.blockquote = -> ''
renderer.heading = -> ''
renderer.html = -> ''
renderer.image = -> ''
renderer.list = -> ''What do you think?
|
Besides my 🎨 comment, I think this looks good 🚀 |
|
👍 Great pull. I'm wondering if blacklisted markdown should be stripped or kept as normal text. |
Allow Markdown in setting descriptions
|
@jerone I figured it was an easy first step to just strip it. If we find a use case where keeping it as normal text is really necessary (beyond "I didn't know that wasn't allowed") then we can add the complexity later. |
Allows Markdown in setting descriptions, for example from my tabs-to-spaces package ...
Before:
After:
Fixes #618