fix parsing attributes with non-breakable space

This commit is contained in:
zadam 2020-08-28 16:00:30 +02:00
parent 268910ed3b
commit 3f69a3c572

View File

@ -311,7 +311,8 @@ export default class AttributeEditorWidget extends TabAwareWidget {
getPreprocessedData() {
const str = this.textEditor.getData()
.replace(/<a[^>]+href="(#[A-Za-z0-9/]*)"[^>]*>[^<]*<\/a>/g, "$1");
.replace(/<a[^>]+href="(#[A-Za-z0-9/]*)"[^>]*>[^<]*<\/a>/g, "$1")
.replace(/&nbsp;/g, " "); // otherwise .text() below outputs non-breaking space in unicode
return $("<div>").html(str).text();
}