Go: x/blog: support Markdown

Created on 29 Aug 2019  Â·  19Comments  Â·  Source: golang/go

If an article has an .md extension, it should render using a Markdown parser. We don’t have to go through the trouble of converting all articles over, but new ones should be in a more broadly supported format.

Perhaps using https://github.com/russross/blackfriday along with https://github.com/microcosm-cc/bluemonday to sanitize content.

@julieqiu with thoughts on Markdown libraries and sanitation đźš®

NeedsFix

Most helpful comment

I have a draft of this working, although the extension is unchanged. CLs to follow shortly.

All 19 comments

I think it is a very good idea!

Would articles written in the Markdown format still support runnable code snippets? If so, one option is to implement a custom rendering engine for blackfriday that interprets snippets like the following as runnable.
````


````
/cc @dmitshur since he's written a renderer for blackfriday before.

I'd love to try this issue :) Pls assign it to me

I have a draft of this working, although the extension is unchanged. CLs to follow shortly.

Change https://golang.org/cl/222839 mentions this issue: content: wrap long lines using new program wrap.go

Change https://golang.org/cl/222841 mentions this issue: content: make spacing consistent + remove comments

Change https://golang.org/cl/222837 mentions this issue: content/company-questionnaire2018: remove UTF BOM and CR LF line endings

Change https://golang.org/cl/222840 mentions this issue: content: use tabs consistently for code blocks + indentation

Change https://golang.org/cl/222842 mentions this issue: content/gouk15: add a few more line breaks

Change https://golang.org/cl/222838 mentions this issue: content: fix some markup typos & mistakes

Change https://golang.org/cl/222846 mentions this issue: present: accept Markdown in present files

Change https://golang.org/cl/222844 mentions this issue: present: improve error for bad author block

Change https://golang.org/cl/222843 mentions this issue: present: allow line-wrapping of bullet list items

Change https://golang.org/cl/222845 mentions this issue: present: record info in AST for reproducing present inputs

Change https://golang.org/cl/222847 mentions this issue: cmd/present2md: add command to convert legacy present to Markdown-enabled present

Change https://golang.org/cl/222848 mentions this issue: content: convert to Markdown-enabled present inputs

Change https://golang.org/cl/231817 mentions this issue: content/constants: fix display of two backquote characters

This has been implemented via the aforementioned CLs. Closing.

Please re-open or file a new issue if there's something more to do here.

Change https://golang.org/cl/245017 mentions this issue: content: fix code block in Publishing Go Modules article

Was this page helpful?
0 / 5 - 0 ratings

Related issues

myitcv picture myitcv  Â·  3Comments

OneOfOne picture OneOfOne  Â·  3Comments

gopherbot picture gopherbot  Â·  3Comments

longzhizhi picture longzhizhi  Â·  3Comments

mingrammer picture mingrammer  Â·  3Comments