russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.43k stars 598 forks source link

V2 fix deprecated alignment attribute #501

Open byteporter opened 5 years ago

byteporter commented 5 years ago

Attribute 'align' is deprecated in HTML5 for th and td (among others). Modified to use inline-CSS instead. Here is a better citation for the deprecation: https://www.w3.org/TR/2011/WD-html-markup-20110113/table.html

byteporter commented 5 years ago

Failed because the test checks for the deprecated style. I'll go ahead and update the test.

=== CONT  TestTable
--- FAIL: TestTable (0.07s)
    helpers_test.go:81: 
        Input   ["a|b|c|d\n:--|--:|:-:|---\ne|f|g|h\n"]
        Expected["<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"]
        Actual  ["<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"]