You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow presentational HTML with Markdown like GitHub #125
@OpenUserJs/admin @OpenUserJs/backend
I've made an experimental patch to the library we use for Markdown (marked) that allows some presentational HTML like you find on GitHub (see here for details).
I've added a branch to OpenUserJS.org that uses the modified library. You'll need to install the new library: npm install marked-whitelist-html
Please test it, try to find ways to break it, and do generally bad things so that it can be fixed and made secure. Thanks.
You'll need to install the new library: npm install marked-whitelist-html
Checking out a detached HEAD from an upstream tracking branch usually works for me... then in that folder I just type $ npm install which checks the current ./package.json file and downloads whatever is needed for the dev run. This is how I did it with the current UI branch.
I'll need a few days to get back to this since the beginning of each month is my most busiest... but I'm looking forward to trying it out when I can. :)
then in that folder I just type $ npm install which checks the current ./package.json file and downloads whatever is needed for the dev run.
I had no idea you could do this. Thanks for the knowledge.
I'll need a few days to get back to this
Totally understandable. I didn't think this would be a quick change. I'm trying to modify a well written library and expect mistakes. Take as much time as you need to test my change.
@Zren Since you're the one basically redoing the entire style of the site, do you mind giving anchor links a background image (icon) like GitHub so people can actually see and copy the url?
@Zrenhttps://github.com/Zren Since you're the one basically redoing
the entire style of the site, do you mind giving anchor links a background
image (icon) like GitHub so people can actually see and copy the url?
—
Reply to this email directly or view it on GitHub #125 (comment)
.
@Zrenhttps://github.com/Zren Since you're the one basically redoing
the entire style of the site, do you mind giving anchor links a
background
image (icon) like GitHub so people can actually see and copy the url?
Activity
Martii commentedon Jun 2, 2014
Checking out a detached HEAD from an upstream tracking branch usually works for me... then in that folder I just type
$ npm installwhich checks the current./package.jsonfile and downloads whatever is needed for the dev run. This is how I did it with the current UI branch.I'll need a few days to get back to this since the beginning of each month is my most busiest... but I'm looking forward to trying it out when I can. :)
sizzlemctwizzle commentedon Jun 2, 2014
I had no idea you could do this. Thanks for the knowledge.
Totally understandable. I didn't think this would be a quick change. I'm trying to modify a well written library and expect mistakes. Take as much time as you need to test my change.
jerone commentedon Jun 2, 2014
You might want to give xss.js a try. It contains the whitelist you copied and more, especially the elements only allowed within a table.
Use xss.js to sanitize HTML mixed with Markdown. Closes #125.
sizzlemctwizzle commentedon Jun 2, 2014
Thank you so much for pointing out that library @jerone. It works great and I'm happy I don't have develop and maintain my own fork.
Martii commentedon Jun 3, 2014
Uhmmm somethings wrong with markdown now and I haven't changed a thing. See this homepage.
Zren commentedon Jun 3, 2014
Pretty sure xss sanitizes HTML, not Markdown. You probably want to reverse
return marked(xss(text));withreturn xss(marked(text));sizzlemctwizzle commentedon Jun 3, 2014
Thanks. Hopefully that fixes things.
sizzlemctwizzle commentedon Jun 3, 2014
@Zren Since you're the one basically redoing the entire style of the site, do you mind giving anchor links a background image (icon) like GitHub so people can actually see and copy the url?
Zren commentedon Jun 3, 2014
Mmmm. They would be nice to have. I'll have to look into how github does it
and it and if there's already a npm package.
This is the code GitHub uses for reference later.
https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/toc_filter.rb
On Mon, Jun 2, 2014 at 9:58 PM, Mike Medley notifications@github.com
wrote:
/ Chris
sizzlemctwizzle commentedon Jun 3, 2014
Actually we have them, but you visually can't see them.
On Jun 2, 2014 9:02 PM, "Chris Holland" notifications@github.com wrote:
Zren commentedon Jun 3, 2014
Ah that's right. There was that heading renderer func. Welp, that was easy.
jerone commentedon Jun 3, 2014
Thought you'd like that. More feature complete and working great.
Swap out simple-xss for sanitize-html