Feature/5757
@@ -509,11 +509,26 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
- **Detail:**
Escapes a string for insertion into HTML, replacing &, <, >, ", `, and ' characters.
+ To disable it for the column titles check the `escapeTitle` option.
- **Default:** `false`
- **Example:** [Table Escape](https://examples.bootstrap-table.com/#options/table-escape.html)
+## escapeTitle
+
+- **Attribute:** `data-escape-title`
+- **Type:** `Boolean`
+- **Detail:**
+ Toggles if the `escape` option should be applied to the column titles.
+- **Default:** `true`
+- **Example:** [Table Escape title](https://examples.bootstrap-table.com/#options/table-escape-title.html)
## filterOptions
- **Attribute:** `data-filter-options`
@@ -355,7 +355,7 @@ class BootstrapTable {
html.push(Utils.sprintf('<div class="th-inner %s">',
this.options.sortable && column.sortable ? `sortable${columnHalign === 'center' ? ' sortable-center' : ''} both` : ''))
- let text = this.options.escape ? Utils.escapeHTML(column.title) : column.title
+ let text = this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(column.title) : column.title
const title = text
@@ -3347,7 +3347,7 @@ class BootstrapTable {
}
this.columns[this.fieldsColumnsIndex[params.field]].title =
- this.options.escape ? Utils.escapeHTML(params.title) : params.title
+ this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(params.title) : params.title
if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
this.$header.find('th[data-field]').each((i, el) => {
@@ -210,6 +210,7 @@ const DEFAULTS = {
showFullscreen: false,
smartDisplay: true,
escape: false,
+ escapeTitle: true,
filterOptions: {
filterAlgorithm: 'and'
},