Skip to content

Commit fed725c

Browse files
zeripathYohann Delafollye
authored andcommitted
Handle yaml frontmatter (go-gitea#11016)
Add goldmark-meta to render yaml frontmatter as a table Fix go-gitea#5377 Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 516d13d commit fed725c

File tree

10 files changed

+422
-0
lines changed

10 files changed

+422
-0
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ require (
106106
github.com/urfave/cli v1.20.0
107107
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
108108
github.com/yuin/goldmark v1.1.25
109+
github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60
109110
go.etcd.io/bbolt v1.3.3 // indirect
110111
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
111112
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,11 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q
614614
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
615615
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53 h1:HsIQ6yAjfjQ3IxPGrTusxp6Qxn92gNVq2x5CbvQvx3w=
616616
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53/go.mod h1:f6elajwZV+xceiaqgRL090YzLEDGSbqr3poGL3ZgXYo=
617+
github.com/yuin/goldmark v1.1.7/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
617618
github.com/yuin/goldmark v1.1.25 h1:isv+Q6HQAmmL2Ofcmg8QauBmDPlUUnSoNhEcC940Rds=
618619
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
620+
github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60 h1:gZucqLjL1eDzVWrXj4uiWeMbAopJlBR2mKQAsTGdPwo=
621+
github.com/yuin/goldmark-meta v0.0.0-20191126180153-f0638e958b60/go.mod h1:i9VhcIHN2PxXMbQrKqXNueok6QNONoPjNMoj9MygVL0=
619622
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
620623
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
621624
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=

modules/markup/markdown/markdown.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
giteautil "code.gitea.io/gitea/modules/util"
1717

1818
"github.com/yuin/goldmark"
19+
meta "github.com/yuin/goldmark-meta"
1920
"github.com/yuin/goldmark/extension"
2021
"github.com/yuin/goldmark/parser"
2122
"github.com/yuin/goldmark/renderer"
@@ -53,6 +54,7 @@ func RenderRaw(body []byte, urlPrefix string, wikiMarkdown bool) []byte {
5354
extension.Ellipsis: nil,
5455
}),
5556
),
57+
meta.New(meta.WithTable()),
5658
),
5759
goldmark.WithParserOptions(
5860
parser.WithAttribute(),

vendor/github.com/yuin/goldmark-meta/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/yuin/goldmark-meta/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/yuin/goldmark-meta/README.md

Lines changed: 147 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/yuin/goldmark-meta/go.mod

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/yuin/goldmark-meta/go.sum

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)