mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
Add support for GitHub-flavoured markdown code fences for highlighting
This commit adds a new PygmentsCodeFences config option (default false), which if true will allow GitHub style backtick code fences around code, which will then be rendered by Pygments. For example: ``` language your code ``` can be used instead of {{< highlight language >}}your code {{< /highlight >}}. Fixes #362
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
fdab118010
commit
c139c6e1ef
@@ -167,9 +167,12 @@ func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Render
|
||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
||||
}
|
||||
|
||||
return blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters)
|
||||
return &HugoHtmlRenderer{
|
||||
blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func getMarkdownExtensions(ctx *RenderingContext) int {
|
||||
flags := 0 | blackfriday.EXTENSION_NO_INTRA_EMPHASIS |
|
||||
blackfriday.EXTENSION_TABLES | blackfriday.EXTENSION_FENCED_CODE |
|
||||
|
Reference in New Issue
Block a user