@@ -933,11 +933,7 @@ function createHoverText(hoverData, opts, gd) {
933
933
if ( fullLayout . meta ) {
934
934
d . name = Lib . templateString ( d . name , { meta : fullLayout . meta } ) ;
935
935
}
936
-
937
- name = svgTextUtils . plainText ( d . name || '' , {
938
- len : d . nameLength ,
939
- allowedTags : [ 'br' , 'sub' , 'sup' , 'b' , 'i' , 'em' ]
940
- } ) ;
936
+ name = plainText ( d . name , d . nameLength ) ;
941
937
}
942
938
943
939
if ( d . zLabel !== undefined ) {
@@ -989,8 +985,10 @@ function createHoverText(hoverData, opts, gd) {
989
985
) ;
990
986
991
987
text = text . replace ( EXTRA_STRING_REGEX , function ( match , extra ) {
992
- name = extra ; // Assign name for secondary text label
993
- return '' ; // Remove from main text label
988
+ // assign name for secondary text label
989
+ name = plainText ( extra , d . nameLength ) ;
990
+ // remove from main text label
991
+ return '' ;
994
992
} ) ;
995
993
}
996
994
@@ -1617,3 +1615,10 @@ function spikesChanged(gd, oldspikepoints) {
1617
1615
) return true ;
1618
1616
return false ;
1619
1617
}
1618
+
1619
+ function plainText ( s , len ) {
1620
+ return svgTextUtils . plainText ( s || '' , {
1621
+ len : len ,
1622
+ allowedTags : [ 'br' , 'sub' , 'sup' , 'b' , 'i' , 'em' ]
1623
+ } ) ;
1624
+ }
0 commit comments