fix(subParsers/stripLinkDefinitions): fix title attribute in link definitions

According to spec, the title attribute in link definitions can be wrapped in single quotes. Previously, showdown didn't support this.
Now the title attribute can be wrapped in single quotes.
pull/163/merge
Estevao Soares dos Santos 2015-06-08 04:16:58 +01:00
parent 307d135e0a
commit 9a2411b05f
5 changed files with 7 additions and 7 deletions

4
dist/showdown.js vendored
View File

@ -1905,7 +1905,7 @@ showdown.subParser('stripBlankLines', function (text) {
showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
'use strict';
var regex = /^[ ]{0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm;
var regex = /^[ ]{0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=~0))/gm;
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += '~0';
@ -1919,7 +1919,7 @@ showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
return m3 + m4;
} else if (m4) {
globals.gTitles[m1] = m4.replace(/"/g, '&quot;');
globals.gTitles[m1] = m4.replace(/"|'/g, '&quot;');
}
// Completely remove the definition from the text

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@
showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
'use strict';
var regex = /^[ ]{0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm;
var regex = /^[ ]{0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=~0))/gm;
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
text += '~0';
@ -40,7 +40,7 @@ showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
return m3 + m4;
} else if (m4) {
globals.gTitles[m1] = m4.replace(/"/g, '&quot;');
globals.gTitles[m1] = m4.replace(/"|'/g, '&quot;');
}
// Completely remove the definition from the text