mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(tablesHeaderId): fix missmatch of option name
In code, the option appeared both as 'tableHeaderId' and 'tablesHeaderId', although only the first form had effect. In documentation was referenced as 'tablesHeaderId'. Option is now fixed in code to reflex the documentation and table parser accepts both forms, with and without an s. Closes #412
This commit is contained in:
parent
1194d8803e
commit
51e46933a4
BIN
dist/showdown.js
vendored
BIN
dist/showdown.js
vendored
Binary file not shown.
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
BIN
dist/showdown.min.js
vendored
BIN
dist/showdown.min.js
vendored
Binary file not shown.
BIN
dist/showdown.min.js.map
vendored
BIN
dist/showdown.min.js.map
vendored
Binary file not shown.
|
@ -22,7 +22,8 @@ showdown.subParser('tables', function (text, options, globals) {
|
|||
function parseHeaders (header, style) {
|
||||
var id = '';
|
||||
header = header.trim();
|
||||
if (options.tableHeaderId) {
|
||||
// support both tablesHeaderId and tableHeaderId due to error in documention so we don't break backwards compatibility
|
||||
if (options.tablesHeaderId || options.tableHeaderId) {
|
||||
id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
|
||||
}
|
||||
header = showdown.subParser('spanGamut')(header, options, globals);
|
||||
|
|
|
@ -97,7 +97,7 @@ describe('makeHtml() features testsuite', function () {
|
|||
suite = tableSuite;
|
||||
for (var i = 0; i < suite.length; ++i) {
|
||||
if (suite[i].name === 'basic-with-header-ids') {
|
||||
converter = new showdown.Converter({tables: true, tableHeaderId: true});
|
||||
converter = new showdown.Converter({tables: true, tablesHeaderId: true});
|
||||
} else if (suite[i].name === '#179.parse-md-in-table-ths') {
|
||||
converter = new showdown.Converter({tables: true, strikethrough: true});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user