]> source.dussan.org Git - gitea.git/commitdiff
Fix table alignment in markdown (#16596)
authorzeripath <art27@cantab.net>
Mon, 2 Aug 2021 16:11:18 +0000 (17:11 +0100)
committerGitHub <noreply@github.com>
Mon, 2 Aug 2021 16:11:18 +0000 (17:11 +0100)
Set the TableOptions in markdown to allow alignment of the tables to work correctly

Fix #15959

Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/markup/markdown/markdown.go

index cac2a180faeef4a96fa9aad4ec5ec17b5351e35b..ab026dd1b85036295d30d10ec18e5e5fa746d82e 100644 (file)
@@ -87,7 +87,9 @@ func newParserContext(ctx *markup.RenderContext) parser.Context {
 func actualRender(ctx *markup.RenderContext, input io.Reader, output io.Writer) error {
        once.Do(func() {
                converter = goldmark.New(
-                       goldmark.WithExtensions(extension.Table,
+                       goldmark.WithExtensions(
+                               extension.NewTable(
+                                       extension.WithTableCellAlignMethod(extension.TableCellAlignAttribute)),
                                extension.Strikethrough,
                                extension.TaskList,
                                extension.DefinitionList,