Skip to content

Commit

Permalink
Use widely-supported method to get align attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
domchristie committed Dec 12, 2017
1 parent abd6a18 commit 7354350
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ rules.tableRow = {
if (isHeadingRow(node)) {
for (var i = 0; i < node.childNodes.length; i++) {
var border = '---'
var align = node.childNodes[i].attributes.align
var align = (
node.childNodes[i].getAttribute('align') || ''
).toLowerCase()

if (align) border = alignMap[align.value] || border
if (align) border = alignMap[align] || border

borderCells += cell(border, node.childNodes[i])
}
Expand Down

0 comments on commit 7354350

Please sign in to comment.