Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2408 - Allow additional safe HTML tags in sanitized markdown #2410

Merged
merged 1 commit into from
Apr 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"md": true,
"module": true,
"moment": true,
"MarkdownSanitizerMixin": true,
"Mousetrap": true,
"PaginationMixin": true,
"Prism": true,
Expand Down
2 changes: 2 additions & 0 deletions grunt-tasks/concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = function(grunt) {
},
issues: {
src: [
"<%= jsPath %>/lib/mixins/extend-md-sanitizer.js",
"<%= jsPath %>/lib/models/label-list.js",
"<%= jsPath %>/lib/editor.js",
"<%= jsPath %>/lib/labels.js",
Expand All @@ -54,6 +55,7 @@ module.exports = function(grunt) {
"<%= jsPath %>/lib/models/label-list.js",
"<%= jsPath %>/lib/models/issue.js",
"<%= jsPath %>/lib/mixins/pagination.js",
"<%= jsPath %>/lib/mixins/extend-md-sanitizer.js",
"<%= jsPath %>/lib/issue-list.js"
],
dest: "<%= jsDistPath %>/issue-list.js"
Expand Down
28 changes: 17 additions & 11 deletions webcompat/static/js/lib/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ issues.CommentsCollection = Backbone.Collection.extend({
}
});

issues.CommentView = Backbone.View.extend({
className: "issue-comment js-Issue-comment grid-cell x2",
id: function() {
return this.model.get("commentLinkId");
},
template: wcTmpl["issue/issue-comment-list.jst"],
render: function() {
this.$el.html(this.template(this.model.toJSON()));
return this;
}
});
var commentMarkdownSanitizer = new MarkdownSanitizerMixin();

issues.CommentView = Backbone.View.extend(
_.extend({}, commentMarkdownSanitizer, {
className: "issue-comment js-Issue-comment grid-cell x2",
id: function() {
return this.model.get("commentLinkId");
},
template: wcTmpl["issue/issue-comment-list.jst"],
render: function() {
var modelData = this.model.toJSON();
modelData.body = this.sanitizeMarkdown(modelData.body);
this.$el.html(this.template(modelData));
return this;
}
})
);
Loading