Commit abc007f6078c212539e82ec6ded480150a72b8e1

Chunlei Wu 2017-09-09T04:02:07

fixed an rendering issue for encoded urls (#1173) If a url contains some special characters, like space or "<", it needs to be encoded in order to be recognized as a valid url. Adding a decoding step allows these urls to render correctly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/plugins/autolinker/prism-autolinker.js b/plugins/autolinker/prism-autolinker.js
index 03b6815..27a46fe 100644
--- a/plugins/autolinker/prism-autolinker.js
+++ b/plugins/autolinker/prism-autolinker.js
@@ -71,6 +71,7 @@ Prism.hooks.add('wrap', function(env) {
 		
 		env.attributes.href = href;
 	}
+	env.content = decodeURIComponent(env.content);
 });
 
-})();
\ No newline at end of file
+})();