aboutsummaryrefslogtreecommitdiffhomepage
path: root/markup
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-09-28 12:06:09 -0700
committerBjørn Erik Pedersen <[email protected]>2024-09-30 08:44:14 +0200
commit1158e6307212fd3ff96f29db0baf79463e0c031e (patch)
treeae119f59d5fd8dbf89c4254165652512971ffd6a /markup
parentd1ba52f3c3bdc31c2067f986fdb57088d875c01e (diff)
downloadhugo-1158e6307212fd3ff96f29db0baf79463e0c031e.tar.gz
hugo-1158e6307212fd3ff96f29db0baf79463e0c031e.zip
markup/goldmark: Change default cell alignment in table render hook
Change the default table cell alignment from "left" to an empty string. Closes #12886
Diffstat (limited to 'markup')
-rw-r--r--markup/goldmark/tables/tables.go2
-rw-r--r--markup/goldmark/tables/tables_integration_test.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/markup/goldmark/tables/tables.go b/markup/goldmark/tables/tables.go
index 0aa6ee269..a7dfb8ee6 100644
--- a/markup/goldmark/tables/tables.go
+++ b/markup/goldmark/tables/tables.go
@@ -129,7 +129,7 @@ func (r *htmlRenderer) renderCell(w util.BufWriter, source []byte, node ast.Node
case gast.AlignCenter:
alignment = "center"
default:
- alignment = "left"
+ alignment = ""
}
cell := hooks.TableCell{Text: hstring.HTML(text), Alignment: alignment}
diff --git a/markup/goldmark/tables/tables_integration_test.go b/markup/goldmark/tables/tables_integration_test.go
index dadce5c81..85cf81c9d 100644
--- a/markup/goldmark/tables/tables_integration_test.go
+++ b/markup/goldmark/tables/tables_integration_test.go
@@ -32,7 +32,7 @@ title = true
| Item | In Stock | Price |
| :---------------- | :------: | ----: |
| Python Hat | True | 23.99 |
-| SQL **Hat** | True | 23.99 |
+| SQL **Hat** | True | 23.99 |
| Codecademy Tee | False | 19.99 |
| Codecademy Hoodie | False | 42.99 |
{.foo foo="bar"}
@@ -65,8 +65,8 @@ Attributes: {{ .Attributes }}|
)
b.AssertFileContent("public/p1/index.html",
- "table-1-thead: 0: 0: left: Month| 1: left: Savings|$",
- "table-1-tbody: 0: 0: left: January| 1: left: $250| 1: 0: left: February| 1: left: $80| 2: 0: left: March| 1: left: $420|$",
+ "table-1-thead: 0: 0: : Month| 1: : Savings|$",
+ "table-1-tbody: 0: 0: : January| 1: : $250| 1: 0: : February| 1: : $80| 2: 0: : March| 1: : $420|$",
)
}