File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 2828 border-left : 0.25rem solid # e7352c ;
2929 margin-top : 1.6em ;
3030}
31+
32+ /*
33+ Fix table column alignment for markdown injected with marked.js.
34+ By default, marked.js uses the deprecated HTML "align" attribute
35+ (e.g. <td align="center">), while Hugo/Goldmark uses inline CSS
36+ (e.g. <td style="text-align:center;">).
37+
38+ Many modern CSS resets override "align", so without this rule
39+ the alignment is lost in dynamically injected tables.
40+ These selectors re-enable the expected alignment for tables
41+ coming from marked.js, without affecting Hugo-built tables.
42+ */
43+ table th [align = "left" ], table td [align = "left" ] {
44+ text-align : left;
45+ }
46+ table th [align = "center" ], table td [align = "center" ] {
47+ text-align : center;
48+ }
49+ table th [align = "right" ], table td [align = "right" ] {
50+ text-align : right;
51+ }
You can’t perform that action at this time.
0 commit comments