We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f3b028 commit e629800Copy full SHA for e629800
1 file changed
public/js/render.js
@@ -3,8 +3,8 @@
3
// allow some attributes
4
var whiteListAttr = ['id', 'class', 'style']
5
window.whiteListAttr = whiteListAttr
6
-// allow link starts with '.', '/' and custom protocol with '://'
7
-var linkRegex = /^([\w|-]+:\/\/)|^([.|/])+/
+// allow link starts with '.', '/' and custom protocol with '://', exclude link starts with javascript://
+var linkRegex = /^(?!javascript:\/\/)([\w|-]+:\/\/)|^([.|/])+/
8
// allow data uri, from https://gist.github.com/bgrins/6194623
9
var dataUriRegex = /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*)\s*$/i
10
// custom white list
0 commit comments