From fff28b185277ee16a36053ded7ad056c746b4b5e Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Thu, 22 Feb 2018 10:18:40 -0500 Subject: [PATCH] strip out tags in display --- package.json | 1 + src/components/containers/Fold.js | 3 ++- src/components/fields/derived.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 112a710fa..3fce06075 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "react-dom": "^16.2.0", "react-select": "^1.0.0-rc.10", "react-tabs": "^2.2.1", + "striptags": "^3.1.1", "tinycolor2": "^1.4.1" }, "devDependencies": { diff --git a/src/components/containers/Fold.js b/src/components/containers/Fold.js index 664f83aa9..21a0c3c0c 100644 --- a/src/components/containers/Fold.js +++ b/src/components/containers/Fold.js @@ -4,6 +4,7 @@ import React, {Component} from 'react'; import classnames from 'classnames'; import {CloseIcon, AngleDownIcon} from 'plotly-icons'; import {unpackPlotProps, localize, containerConnectedContextTypes} from 'lib'; +import striptags from 'striptags'; class Fold extends Component { constructor(props, context) { @@ -96,7 +97,7 @@ class Fold extends Component {
{arrowIcon} {icon} -
{name}
+
{striptags(name)}
{deleteButton(deleteContainer)} diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index 7cc834dcb..225cea46d 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -8,6 +8,7 @@ import { connectToContainer, supplyLayoutPlotProps, } from 'lib'; +import striptags from 'striptags'; export const CanvasSize = connectToContainer(UnconnectedNumeric, { modifyPlotProps: (props, context, plotProps) => { @@ -276,7 +277,7 @@ function computeAxesRefOptions(axes) { const ax = axes[i]; // checking user data for title avoids default "Click to enter axis title" - const label = ax._input.title || ax._id; + const label = striptags(ax._input.title || ax._id); options[i] = {label, value: ax._id}; }