Handle yaml frontmatter (#11016)

Add goldmark-meta to render yaml frontmatter as a table

Fix #5377

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2020-04-09 11:54:50 +01:00 committed by GitHub
parent c02dee8bc4
commit 0be25e2150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 422 additions and 0 deletions

View file

@ -16,6 +16,7 @@ import (
giteautil "code.gitea.io/gitea/modules/util"
"github.com/yuin/goldmark"
meta "github.com/yuin/goldmark-meta"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/renderer"
@ -53,6 +54,7 @@ func RenderRaw(body []byte, urlPrefix string, wikiMarkdown bool) []byte {
extension.Ellipsis: nil,
}),
),
meta.New(meta.WithTable()),
),
goldmark.WithParserOptions(
parser.WithAttribute(),