sanitize_html_v2.patch

Marius BALTEANU, 2020-10-16 07:47

Download (1.01 KB)

View differences:

public/javascripts/application.js
8 8
  }
9 9
});
10 10

  
11
function sanitizeHTML(string) {
12
  var temp = document.createElement('span');
13
  temp.textContent = string;
14
  return temp.innerHTML;
15
}
16

  
11 17
function checkAll(id, checked) {
12 18
  $('#'+id).find('input[type=checkbox]:enabled').prop('checked', checked);
13 19
}
......
1081 1087
      lookup: 'label',
1082 1088
      fillAttr: 'label',
1083 1089
      requireLeadingSpace: true,
1084
      selectTemplate: function (issue) {
1085
        return '#' + issue.original.id;
1090
      selectTemplate: function ({ original }) {
1091
        return '#' + original.id;
1092
      },
1093
      menuItemTemplate: function ({ original }) {
1094
        return sanitizeHTML(original.label);
1086 1095
      },
1087 1096
      noMatchTemplate: function () {
1088 1097
        return '<span style:"visibility: hidden;"></span>';