New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

showdown-ghost-footnotes

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

showdown-ghost-footnotes - npm Package Compare versions

Comparing version

to
0.0.4

test/cases/inline-code-in-link-title-breaks-footnotes.html

10

bower.json
{
"name": "showdown-footnotes",
"name": "showdown-ghost-footnotes",
"description": "Add footnotes support to showdown",

@@ -7,3 +7,3 @@ "homepage": "https://github.com/tivie/showdown-footnotes",

"authors": [
"Estev�o Soares dos Santos (https://github.com/tivie)"
"Estevão Soares dos Santos (https://github.com/tivie)"
],

@@ -18,6 +18,6 @@ "keywords": [

"type": "git",
"url": "https://github.com/tivie/showdown-footnotes.git",
"web": "https://github.com/tivie/showdown-footnotes"
"url": "https://github.com/tivie/showdown-ghost-footnotes.git",
"web": "https://github.com/tivie/showdown-ghost-footnotes"
},
"main": ["src/showdown-footnotes.js"],
"main": ["src/showdown-ghost-footnotes.js"],
"ignore": [

@@ -24,0 +24,0 @@ "test/",

{
"name": "showdown-ghost-footnotes",
"version": "0.0.3",
"description": "Add footnotes support to showdown",
"version": "0.0.4",
"description": "Add footnotes support to showdown in ghost",
"keywords": [

@@ -27,4 +27,4 @@ "markdown",

"js-beautify": "^1.5.10",
"showdown": "^1.6.1"
"showdown": "^1.6.2"
}
}

@@ -89,4 +89,4 @@ /**

// we will use our own escape character (trema) to prevent clash with showdown main
text = text.replace(/¨/g, '¨T');
// we will use our own escape character § to prevent clash with showdown main
text = text.replace(/§/g, '§T');

@@ -97,3 +97,3 @@ // first strip the reference footnotes

text = text.replace(/^ {0,3}\[\^(.+?)]:[ \t]?([\s\S]+?)(?=~0|\n {0,2}[\S]|^ {0,3}\[\^(.+?)]:)/gm, function(wholematch, ref, content) {
ref = ref.replace(/\$/g, '¨D');
ref = ref.replace(/\$/g, '§D');
footRefs[ref] = {

@@ -104,3 +104,3 @@ content: content,

// we return a marker so we can bail with orphaned references
return '¨F¨R¨S' + ref + '¨F¨R¨E';
return '§F§R§S' + ref + '§F§R§E';
});

@@ -112,9 +112,9 @@

//escape dollar signs (magic in regex)
ref = ref.replace(/\$/g, '¨D');
ref = ref.replace(/\$/g, '§D');
footMarkers.push(ref);
// we now return only the ref, but double escaped with "¨F¨M" to prevent it being
// we now return only the ref, but double escaped with "§F§M" to prevent it being
// parsed as a link in case of something like this:
// [^1] (http://some.url.that.is.inside.parenthesis.com)
return "¨F¨M¨S" + ref + "¨F¨M¨E";
return "§F§M§S" + ref + "§F§M§E";
});

@@ -142,3 +142,3 @@

if (footRefs.hasOwnProperty(uRef)) {
text = text.replace(new RegExp('¨F¨R¨S' + uRef + '¨F¨R¨E', 'g'), footRefs[uRef].wMatch);
text = text.replace(new RegExp('§F§R§S' + uRef + '§F§R§E', 'g'), footRefs[uRef].wMatch);
}

@@ -149,8 +149,8 @@ }

for (var y = 0; y < orphanedRefs.length; ++y) {
var oRef = orphanedRefs[y].replace(/¨D/g, '$');
text = text.replace(new RegExp('¨F¨M¨S' + oRef + '¨F¨M¨E', 'g'), '[^' + oRef + ']');
var oRef = orphanedRefs[y].replace(/§D/g, '$');
text = text.replace(new RegExp('§F§M§S' + oRef + '§F§M§E', 'g'), '[^' + oRef + ']');
}
// lastly we strip the footnote tokens
text = text.replace(/¨F¨R¨S(.+?)¨F¨R¨E/g, '');
text = text.replace(/§F§R§S(.+?)§F§R§E/g, '');

@@ -188,3 +188,3 @@ // and remove the sentinel

// replace markers with markup
text = text.replace('¨F¨M¨S' + ref + '¨F¨M¨E', mk);
text = text.replace('§F§M§S' + ref + '§F§M§E', mk);

@@ -204,4 +204,4 @@ // parse footnotes md

// lastly we unescape trema
text = text.replace(/¨T/g, '¨');
// lastly we unescape §
text = text.replace(/§T/g, '§');

@@ -208,0 +208,0 @@ // Add footnotes to the end of file and return

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet