suneditor 2.45.1 → 2.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,7 +88,7 @@ export default {
88
88
 
89
89
  if (currentFont !== fontContext.currentFont) {
90
90
  for (let i = 0, len = fontList.length; i < len; i++) {
91
- if (currentFont === fontList[i].getAttribute('data-value')) {
91
+ if (currentFont === (fontList[i].getAttribute('data-value') || '').replace(/'|"/g, '')) {
92
92
  this.util.addClass(fontList[i], 'active');
93
93
  } else {
94
94
  this.util.removeClass(fontList[i], 'active');
@@ -105,10 +105,13 @@ export default {
105
105
  e.preventDefault();
106
106
  e.stopPropagation();
107
107
 
108
- const value = e.target.getAttribute('data-value');
108
+ let value = e.target.getAttribute('data-value');
109
109
 
110
110
  if (value) {
111
111
  const newNode = this.util.createElement('SPAN');
112
+ if (/[\s\d\W]/.test(value) && !/^['"].*['"]$/.test(value)) {
113
+ value = '"' + value + '"';
114
+ }
112
115
  newNode.style.fontFamily = value;
113
116
  this.nodeChange(newNode, ['font-family'], null, null);
114
117
  } else {