fix(makemarkdown.table): col text align right

fix for html columns align right. currently hmtl cols
with align right get converted to md with align center
e.g. html
<th style="text-align: right">head</th>
get converted to
:---: (suddenly center)
this pull request fixes that bug
This commit is contained in:
chris 2019-05-01 12:56:38 +02:00
parent 33bba54535
commit 5f85c53910

View File

@ -55,7 +55,7 @@ showdown.subParser('makeMarkdown.table', function (node, globals) {
for (ii = 0; ii < tableArray[i].length; ++ii) {
if (i === 1) {
if (tableArray[i][ii].slice(-1) === ':') {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(0, -1), cellSpacesCount - 1, '-') + ':';
} else {
tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
}