Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed #26 -- Urls which contained matched parenthesis are now supported #30

Merged
merged 2 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 10, 2012
  1. @tstone
Commits on Aug 11, 2012
  1. @tstone
This page is out of date. Refresh to see the latest.
View
2  src/showdown.js
@@ -483,7 +483,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]
View
4 test/cases/github-style-linebreaks.html
@@ -0,0 +1,4 @@
+
+<pre><code>code can go here
+this is rendered on a second line
+</code></pre>
View
4 test/cases/github-style-linebreaks.md
@@ -0,0 +1,4 @@
+```
+code can go here
+this is rendered on a second line
+```
View
2  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>
View
2  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
Something went wrong with that request. Please try again.