mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
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.
This commit is contained in:
parent
307d135e0a
commit
9a2411b05f
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.
|
@ -26,7 +26,7 @@
|
||||||
showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
|
showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
|
||||||
'use strict';
|
'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
|
// attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
|
||||||
text += '~0';
|
text += '~0';
|
||||||
|
@ -40,7 +40,7 @@ showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
|
||||||
return m3 + m4;
|
return m3 + m4;
|
||||||
|
|
||||||
} else if (m4) {
|
} else if (m4) {
|
||||||
globals.gTitles[m1] = m4.replace(/"/g, '"');
|
globals.gTitles[m1] = m4.replace(/"|'/g, '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Completely remove the definition from the text
|
// Completely remove the definition from the text
|
||||||
|
|
Loading…
Reference in New Issue
Block a user