@@ -933,11 +933,7 @@ function createHoverText(hoverData, opts, gd) {
933933 if ( fullLayout . meta ) {
934934 d . name = Lib . templateString ( d . name , { meta : fullLayout . meta } ) ;
935935 }
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 ) ;
941937 }
942938
943939 if ( d . zLabel !== undefined ) {
@@ -989,8 +985,10 @@ function createHoverText(hoverData, opts, gd) {
989985 ) ;
990986
991987 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 '' ;
994992 } ) ;
995993 }
996994
@@ -1617,3 +1615,10 @@ function spikesChanged(gd, oldspikepoints) {
16171615 ) return true ;
16181616 return false ;
16191617}
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