|
@@ -1,7 +1,7 @@
|
|
-showdown.subParser('headers', function (text, options, globals) {
|
|
|
|
|
|
+showdown.subParser('makehtml.headers', function (text, options, globals) {
|
|
'use strict';
|
|
'use strict';
|
|
|
|
|
|
- text = globals.converter._dispatch('headers.before', text, options, globals);
|
|
|
|
|
|
+ text = globals.converter._dispatch('makehtml.headers.before', text, options, globals);
|
|
|
|
|
|
var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
|
|
var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
|
|
|
|
|
|
@@ -17,19 +17,19 @@ showdown.subParser('headers', function (text, options, globals) {
|
|
|
|
|
|
text = text.replace(setextRegexH1, function (wholeMatch, m1) {
|
|
text = text.replace(setextRegexH1, function (wholeMatch, m1) {
|
|
|
|
|
|
- var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
|
|
|
|
|
|
+ var spanGamut = showdown.subParser('makehtml.spanGamut')(m1, options, globals),
|
|
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
|
|
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
|
|
hLevel = headerLevelStart,
|
|
hLevel = headerLevelStart,
|
|
hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
|
|
hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
|
|
- return showdown.subParser('hashBlock')(hashBlock, options, globals);
|
|
|
|
|
|
+ return showdown.subParser('makehtml.hashBlock')(hashBlock, options, globals);
|
|
});
|
|
});
|
|
|
|
|
|
text = text.replace(setextRegexH2, function (matchFound, m1) {
|
|
text = text.replace(setextRegexH2, function (matchFound, m1) {
|
|
- var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
|
|
|
|
|
|
+ var spanGamut = showdown.subParser('makehtml.spanGamut')(m1, options, globals),
|
|
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
|
|
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
|
|
hLevel = headerLevelStart + 1,
|
|
hLevel = headerLevelStart + 1,
|
|
hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
|
|
hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
|
|
- return showdown.subParser('hashBlock')(hashBlock, options, globals);
|
|
|
|
|
|
+ return showdown.subParser('makehtml.hashBlock')(hashBlock, options, globals);
|
|
});
|
|
});
|
|
|
|
|
|
// atx-style headers:
|
|
// atx-style headers:
|
|
@@ -47,12 +47,12 @@ showdown.subParser('headers', function (text, options, globals) {
|
|
hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
|
|
hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
|
|
}
|
|
}
|
|
|
|
|
|
- var span = showdown.subParser('spanGamut')(hText, options, globals),
|
|
|
|
|
|
+ var span = showdown.subParser('makehtml.spanGamut')(hText, options, globals),
|
|
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
|
|
hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
|
|
hLevel = headerLevelStart - 1 + m1.length,
|
|
hLevel = headerLevelStart - 1 + m1.length,
|
|
header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
|
|
header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
|
|
|
|
|
|
- return showdown.subParser('hashBlock')(header, options, globals);
|
|
|
|
|
|
+ return showdown.subParser('makehtml.hashBlock')(header, options, globals);
|
|
});
|
|
});
|
|
|
|
|
|
function headerId (m) {
|
|
function headerId (m) {
|
|
@@ -121,6 +121,6 @@ showdown.subParser('headers', function (text, options, globals) {
|
|
return title;
|
|
return title;
|
|
}
|
|
}
|
|
|
|
|
|
- text = globals.converter._dispatch('headers.after', text, options, globals);
|
|
|
|
|
|
+ text = globals.converter._dispatch('makehtml.headers.after', text, options, globals);
|
|
return text;
|
|
return text;
|
|
});
|
|
});
|