Skip to content

Commit

Permalink
Add parserRules to make links and the buttons work
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Mar 25, 2012
1 parent 1043754 commit d9c43de
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/bootstrap-wysihtml5.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,34 @@
"lists": true
};

var parserRules = {
tags: {
b: {},
i: {},
br: {},
ol: {},
ul: {},
li: {},
h1: {},
h2: {},
a: {
set_attributes: {
target: "_blank",
rel: "nofollow"
},
check_attributes: {
href: "url" // important to avoid XSS
}
}
}
};

var Wysihtml5 = function(el, options) {
this.el = el;
this.toolbar = this.createToolbar(el, options || defaultOptions);
this.editor = new wysi.Editor(this.el.attr('id'), {
toolbar: this.toolbar.attr('id')
toolbar: this.toolbar.attr('id'),
parserRules: parserRules
});

$('iframe.wysihtml5-sandbox').each(function(i, el){
Expand Down

0 comments on commit d9c43de

Please sign in to comment.