Fixed regression in PageDown Extra
This commit is contained in:
parent
4005d1e7a8
commit
a3774c281d
@ -591,6 +591,16 @@ div.dropdown-menu i {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Definition list */
|
||||||
|
dt, dd {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Table style */
|
/* Table style */
|
||||||
table {
|
table {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
@ -95,6 +95,9 @@
|
|||||||
// Convert internal markdown using the stock pagedown converter
|
// Convert internal markdown using the stock pagedown converter
|
||||||
function convertAll(text, extra) {
|
function convertAll(text, extra) {
|
||||||
var result = extra.blockGamutHookCallback(text);
|
var result = extra.blockGamutHookCallback(text);
|
||||||
|
// We need to perform these operations since we skip the steps in the converter
|
||||||
|
result = unescapeSpecialChars(result);
|
||||||
|
result = result.replace(/~D/g, "$$").replace(/~T/g, "~");
|
||||||
result = extra.previousPostConversion(result);
|
result = extra.previousPostConversion(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -108,6 +111,19 @@
|
|||||||
return text.replace(/\\\|/g, '|').replace(/\\:/g, ':');
|
return text.replace(/\\\|/g, '|').replace(/\\:/g, ':');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Duplicated from PageDown converter
|
||||||
|
function unescapeSpecialChars(text) {
|
||||||
|
//
|
||||||
|
// Swap back in all the special characters we've hidden.
|
||||||
|
//
|
||||||
|
text = text.replace(/~E(\d+)E/g,
|
||||||
|
function (wholeMatch, m1) {
|
||||||
|
var charCodeToReplace = parseInt(m1);
|
||||||
|
return String.fromCharCode(charCodeToReplace);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* Markdown.Extra *
|
* Markdown.Extra *
|
||||||
@ -238,10 +254,7 @@
|
|||||||
text = text.replace(/<p>~X(\d+)X<\/p>/g, function(wholeMatch, m1) {
|
text = text.replace(/<p>~X(\d+)X<\/p>/g, function(wholeMatch, m1) {
|
||||||
hasHash = true;
|
hasHash = true;
|
||||||
var key = parseInt(m1, 10);
|
var key = parseInt(m1, 10);
|
||||||
var result = self.hashBlocks[key];
|
return self.hashBlocks[key];
|
||||||
// We need to perform that since we skipped the steps in the converter
|
|
||||||
result = result.replace(/~D/g, "$$").replace(/~T/g, "~");
|
|
||||||
return result;
|
|
||||||
});
|
});
|
||||||
if(hasHash === true) {
|
if(hasHash === true) {
|
||||||
recursiveUnHash();
|
recursiveUnHash();
|
||||||
|
Loading…
Reference in New Issue
Block a user