Skip to content

Commit e83b650

Browse files
strip out tags in display (#345)
1 parent 58efaa0 commit e83b650

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"react-dom": "^16.2.0",
2323
"react-select": "^1.0.0-rc.10",
2424
"react-tabs": "^2.2.1",
25+
"striptags": "^3.1.1",
2526
"tinycolor2": "^1.4.1"
2627
},
2728
"devDependencies": {

src/components/containers/Fold.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React, {Component} from 'react';
44
import classnames from 'classnames';
55
import {CloseIcon, AngleDownIcon} from 'plotly-icons';
66
import {unpackPlotProps, localize, containerConnectedContextTypes} from 'lib';
7+
import striptags from 'striptags';
78

89
class Fold extends Component {
910
constructor(props, context) {
@@ -96,7 +97,7 @@ class Fold extends Component {
9697
<div className="fold__top__arrow-title">
9798
{arrowIcon}
9899
{icon}
99-
<div className="fold__top__title">{name}</div>
100+
<div className="fold__top__title">{striptags(name)}</div>
100101
</div>
101102
{deleteButton(deleteContainer)}
102103
</div>

src/components/fields/derived.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
connectToContainer,
99
supplyLayoutPlotProps,
1010
} from 'lib';
11+
import striptags from 'striptags';
1112

1213
export const CanvasSize = connectToContainer(UnconnectedNumeric, {
1314
modifyPlotProps: (props, context, plotProps) => {
@@ -276,7 +277,7 @@ function computeAxesRefOptions(axes) {
276277
const ax = axes[i];
277278

278279
// checking user data for title avoids default "Click to enter axis title"
279-
const label = ax._input.title || ax._id;
280+
const label = striptags(ax._input.title || ax._id);
280281
options[i] = {label, value: ax._id};
281282
}
282283

0 commit comments

Comments
 (0)