These are chat archives for jescalan/roots

11th
Mar 2017
Jonathan Reeve
@JonathanReeve
Mar 11 2017 19:04
Sorry for the newbie question, but does anyone know how to render data as markdown? I'm loading data from YAML and displaying it OK with jade, now I just need to have the string rendered as markdown first.
Tom Kraak
@tkraak
Mar 11 2017 19:32
@JonathanReeve … use a markdown parser such as marked
that readme has a section on marked
markdown-it is another parser, more actively mainted than marked I believe
Jonathan Reeve
@JonathanReeve
Mar 11 2017 19:39
Cool, I'll give that a try, thanks
Jonathan Reeve
@JonathanReeve
Mar 11 2017 19:47
So I have marked = require 'marked' and locals: md: marked in my app.coffee, and in my jade file I have p= md(data.object.thing), which outputs the raw HTML, i.e. markdown is correctly transformed to HTML, but then I see the HTML code on my website
Am I doing something wrong?
Tom Kraak
@tkraak
Mar 11 2017 19:55
use p!=
Jonathan Reeve
@JonathanReeve
Mar 11 2017 20:04
Ah! Thanks
Jonathan Reeve
@JonathanReeve
Mar 11 2017 20:28
So that totally worked, but now my yaml strings are automatically being wrapped in <p> tags--is this an option that can be turned off for marked?
Tom Kraak
@tkraak
Mar 11 2017 20:35
you have a repo you can point me to?
Jonathan Reeve
@JonathanReeve
Mar 11 2017 20:38
Not yet. But I just figured out how to get things inside the paragraph, with md('Some string' + data)
Tom Kraak
@tkraak
Mar 11 2017 20:40
👍🏼
Jeff Escalante
@jescalan
Mar 11 2017 21:54
:raised_hands: