Pulled out of @Braintelligence's https://github.com/plotly/plotly.js/issues/3175#issuecomment-448565062

or simply in https://codepen.io/etpinard/pen/QzRzBe
Would something like:

look good enough?
Maybe valign the value? :p
Example of a more extreme case:
Plotly.newPlot('graph', [{
y: [1, 2, 1],
name: 'Multi<br>line<br>trace<br>name',
hoverlabel: {namelength: -1},
hoverinfo: 'x+y+name'
}, {
y: [1, 2, 1],
name: 'Multi<br>line<br>trace<br>name',
hoverinfo: 'x+y+name',
hoverlabel: {namelength: -1}
}], {
showlegend: true
})

Maybe valign the value? :p
That could work. @plotly/plotly_js any thoughts on this?
Otherwise it looks OK! :) Thanks a bunch
Currently multiline primary text with a single-line name leaves the name top-aligned with the text box, which makes me think the default with more lines in the name than in the primary text should be the same, top-aligned. But an attribute to switch that to middle-aligned or bottom-aligned would be great to add at some point.
makes me think the default with more lines in the name than in the primary text should be the same
Pushed to https://github.com/plotly/plotly.js/pull/3443
But an attribute to switch that to middle-aligned or bottom-aligned would be great to add at some point.
Most helpful comment
Pushed to https://github.com/plotly/plotly.js/pull/3443
Now in https://github.com/plotly/plotly.js/issues/3010