Skip to content

Commit

Permalink
Fixed url parsing regexp in Prism grammar. Fixed #634
Browse files Browse the repository at this point in the history
  • Loading branch information
benweet committed Dec 14, 2014
1 parent 8802ec8 commit 4c7cb8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/res/libs/prism-markdown.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Prism.languages.md = (function() {

var charInsideUrl = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",
charEndingUrl = "[-A-Z0-9+&@#/%=~_|[\\])]";
var charInsideUrl = "(&|[-A-Z0-9+@#/%?=~_|[\\]()!:,.;])",
charEndingUrl = "(&|[-A-Z0-9+@#/%=~_|[\\])])";
var urlPattern = new RegExp("(https?|ftp)(://" + charInsideUrl + "*" + charEndingUrl + ")(?=$|\\W)", "gi");
var emailPattern = /(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)/gi;

Expand Down

0 comments on commit 4c7cb8c

Please sign in to comment.