musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.14k stars 2.63k forks source link

Volta text cannot contain & #13796

Open tjfsteele opened 1 year ago

tjfsteele commented 1 year ago

Volta text cannot contain &. Workaround is to enter & amp;

This bug is in 3.6 and also 4.x

wizofaus commented 3 months ago

Happy to fix but what's the right solution while maintaining backward compatibility? Just treat "&" as a special case, but otherwise assume it's unformatted text with no markup?

Jojo-Schmitz commented 3 months ago

Just treat it as markup, using toHtmlEscaped()

wizofaus commented 3 months ago

So, call that on whatever the user types before storing the underlying value - and the opposite before displaying in the text field (it's not 100% clear what the opposite should be, QTextDocumentFragment::fromHtml(escapedString).toPlainText(); appears to be the closest). This will also mean any HTML tags (<i> <b> etc.) are ignored, but they appear to be currently anyway.