support unicode in button names, closes #1250

This commit is contained in:
zadam 2020-09-17 14:41:00 +02:00
parent 6220b02ef0
commit c371873b7e

View File

@ -87,7 +87,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @param {ToolbarButtonOptions} opts
*/
this.addButtonToToolbar = opts => {
const buttonId = "toolbar-button-" + opts.title.replace(/[^a-zA-Z0-9]/g, "-");
const buttonId = "toolbar-button-" + opts.title.replace(/\s/g, "-");
const button = $('<button>')
.addClass("btn btn-sm")