mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
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:
parent
33bba54535
commit
5f85c53910
|
@ -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, '-');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user