Skip to content

Commit

Permalink
fix(subParsers/stripLinkDefinitions): fix title attribute in link def…
Browse files Browse the repository at this point in the history
…initions

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.
  • Loading branch information
tivie committed Jun 8, 2015
1 parent 307d135 commit 9a2411b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/subParsers/stripLinkDefinitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
Expand Down

0 comments on commit 9a2411b

Please sign in to comment.