Browse Source

Merge branch 'master' into syntax-extensions

Titus 13 years ago
parent
commit
0e4c052373
4 changed files with 11 additions and 3 deletions
  1. 6 2
      package.json
  2. 1 1
      src/showdown.js
  3. 2 0
      test/cases/url-with-parenthesis.html
  4. 2 0
      test/cases/url-with-parenthesis.md

+ 6 - 2
package.json

@@ -15,12 +15,16 @@
     ],
     "repository": {
         "type": "git",
-        "url": "https://github.com/coreyti/showdown.git"
+        "url":  "https://github.com/coreyti/showdown.git",
+        "web":  "https://github.com/coreyti/showdown"
     },
     "devDependencies": {
         "mocha": "*",
         "should": "*"
     },
-    "licenses": [{ "type": "BSD" }],
+    "licenses": [{
+        "type": "BSD",
+        "url":  "https://github.com/coreyti/showdown/raw/master/license.txt"
+    }],
     "main": "./src/showdown"
 }

+ 1 - 1
src/showdown.js

@@ -585,7 +585,7 @@ var _DoAnchors = function(text) {
 		)
 		/g,writeAnchorTag);
 	*/
-	text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,writeAnchorTag);
+	text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,writeAnchorTag);
 
 	//
 	// Last, handle reference-style shortcuts: [link text]

+ 2 - 0
test/cases/url-with-parenthesis.html

@@ -0,0 +1,2 @@
+
+<p>There's an <a href="http://en.memory-alpha.org/wiki/Darmok_(episode)">episode</a> of Star Trek: The Next Generation</p>

+ 2 - 0
test/cases/url-with-parenthesis.md

@@ -0,0 +1,2 @@
+
+There's an [episode](http://en.memory-alpha.org/wiki/Darmok_(episode)) of Star Trek: The Next Generation