Hugo: Obsolete attribute align on td with Goldmark

Created on 5 May 2020  路  3Comments  路  Source: gohugoio/hugo

What version of Hugo are you using (hugo version)? Hugo 0.67

Does this issue reproduce with the latest release? Yes

The markdown

| Tag (decimal)         | Tag (hex)             | Type                  |
| ---------------------:| ---------------------:| --------------------- |
| 2                     | 02                    | INTEGER               |

With Goldmark generate html containing

<td align="right">2</td>

Witch is not valid: the align attribute is obsolete https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-align and marked as ERROR with html5validator.

Hugo should allow the configuration of css class to replace those deprecated attributes.

Apparently Goldmark provides a way to do so: https://github.com/yuin/goldmark/pull/78#issuecomment-568905772

Posted first in https://discourse.gohugo.io/t/obsolete-attribute-align-on-td-with-goldmark/25021

Bug

Most helpful comment

goldmark v1.2.0 has been released. Table extension gets a new option.
https://github.com/yuin/goldmark/commit/bd58441cc141c6455d2ed592a4f1d01adee4211a

All 3 comments

Only if the last part of https://github.com/yuin/goldmark/pull/78#issuecomment-622670551 gets implementedd. We're not adding any special HTML rendering logic in Hugo to handle this.

goldmark v1.2.0 has been released. Table extension gets a new option.
https://github.com/yuin/goldmark/commit/bd58441cc141c6455d2ed592a4f1d01adee4211a

Removed upstream tag as goldmark now supports options to control this.

Was this page helpful?
0 / 5 - 0 ratings