diff --git a/modules/presets/category.js b/modules/presets/category.js index aadecbbd4..c97f52063 100644 --- a/modules/presets/category.js +++ b/modules/presets/category.js @@ -36,7 +36,7 @@ export function presetCategory(categoryID, category, allPresets) { _this.matchScore = () => -1; _this.name = () => t(`_tagging.presets.categories.${categoryID}.name`, { 'default': categoryID }); - _this.nameLabel = () => t.html(`_tagging.presets.categories.${categoryID}.name`, { 'default': categoryID }); + _this.nameLabel = () => t.append(`_tagging.presets.categories.${categoryID}.name`, { 'default': categoryID }); _this.terms = () => []; diff --git a/modules/presets/preset.js b/modules/presets/preset.js index 65f983780..4cb5c9f62 100644 --- a/modules/presets/preset.js +++ b/modules/presets/preset.js @@ -94,9 +94,9 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { return t(textID, options); }; - _this.t.html = (scope, options) => { + _this.t.append = (scope, options) => { const textID = `_tagging.presets.presets.${presetID}.${scope}`; - return t.html(textID, options); + return t.append(textID, options); }; @@ -104,9 +104,7 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { return _this.t('name', { 'default': _this.originalName }); }; - _this.nameLabel = () => { - return _this.t.html('name', { 'default': _this.originalName }); - }; + _this.nameLabel = () => _this.t.append('name', { 'default': _this.originalName }); _this.subtitle = () => { if (_this.suggestion) { @@ -121,7 +119,7 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) { if (_this.suggestion) { let path = presetID.split('/'); path.pop(); // remove brand name - return t.html('_tagging.presets.presets.' + path.join('/') + '.name'); + return t.append('_tagging.presets.presets.' + path.join('/') + '.name'); } return null; }; diff --git a/modules/ui/preset_list.js b/modules/ui/preset_list.js index f2e9100fc..ba9b0bf4f 100644 --- a/modules/ui/preset_list.js +++ b/modules/ui/preset_list.js @@ -329,7 +329,8 @@ export function uiPresetList(context) { .attr('class', 'namepart') .call(svgIcon((localizer.textDirection() === 'rtl' ? '#iD-icon-backward' : '#iD-icon-forward'), 'inline')) .append('span') - .html(function() { return preset.nameLabel() + '…'; }); + .call(preset.nameLabel()) + .append('span').text('…'); box = selection.append('div') .attr('class', 'subgrid') @@ -402,7 +403,7 @@ export function uiPresetList(context) { .enter() .append('div') .attr('class', 'namepart') - .html(function(d) { return d; }); + .each(function(d) { d(d3_select(this)); }); wrap.call(item.reference.button); selection.call(item.reference.body); diff --git a/modules/ui/sections/feature_type.js b/modules/ui/sections/feature_type.js index 403591cdd..7939a7605 100644 --- a/modules/ui/sections/feature_type.js +++ b/modules/ui/sections/feature_type.js @@ -1,4 +1,5 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; +import { select as d3_select } from 'd3-selection'; import { presetManager } from '../../presets'; import { utilArrayIdentical } from '../../util/array'; @@ -108,7 +109,7 @@ export function uiSectionFeatureType(context) { .enter() .append('div') .attr('class', 'namepart') - .html(function(d) { return d; }); + .each(function(d) { return d(d3_select(this)); }); } section.entityIDs = function(val) {