Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 fix deprecated alignment attribute #501

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,10 +1282,10 @@ func TestTable(t *testing.T) {
"<tbody>\n<tr>\n<td><em>d</em></td>\n<td><strong>e</strong></td>\n<td>f</td>\n</tr>\n</tbody>\n</table>\n",

"a|b|c|d\n:--|--:|:-:|---\ne|f|g|h\n",
"<table>\n<thead>\n<tr>\n<th align=\"left\">a</th>\n<th align=\"right\">b</th>\n" +
"<th align=\"center\">c</th>\n<th>d</th>\n</tr>\n</thead>\n\n" +
"<tbody>\n<tr>\n<td align=\"left\">e</td>\n<td align=\"right\">f</td>\n" +
"<td align=\"center\">g</td>\n<td>h</td>\n</tr>\n</tbody>\n</table>\n",
"<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">a</th>\n<th style=\"text-align: right;\">b</th>\n" +
"<th style=\"text-align: center;\">c</th>\n<th>d</th>\n</tr>\n</thead>\n\n" +
"<tbody>\n<tr>\n<td style=\"text-align: left;\">e</td>\n<td style=\"text-align: right;\">f</td>\n" +
"<td style=\"text-align: center;\">g</td>\n<td>h</td>\n</tr>\n</tbody>\n</table>\n",

"a|b|c\n---|---|---\n",
"<table>\n<thead>\n<tr>\n<th>a</th>\n<th>b</th>\n<th>c</th>\n</tr>\n</thead>\n\n<tbody>\n</tbody>\n</table>\n",
Expand Down
2 changes: 1 addition & 1 deletion html.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ func (r *HTMLRenderer) RenderNode(w io.Writer, node *Node, entering bool) WalkSt
if entering {
align := cellAlignment(node.Align)
if align != "" {
attrs = append(attrs, fmt.Sprintf(`align="%s"`, align))
attrs = append(attrs, fmt.Sprintf(`style="text-align: %s;"`, align))
}
if node.Prev == nil {
r.cr(w)
Expand Down