Font names with spaces (e.g., "Times New Roman") cause malformed HTML output
Checklist
- [x] I've looked at the documentation to make sure the behavior isn't documented and expected.
- [x] I'm sure this is an issue with Summernote, not with my app or other dependencies (Angular, Cordova, React, etc.).
- [x] I've searched through the current issues to make sure this hasn't been reported yet.
- [x] My issue is pertinent to this repository of Summernote (jQuery), or I was unable to have my issue resolved from the relevant version I'm using, such as Angular, dJango, Rails or React. Please try your issue at the relevent repository first.
- [x] I understand that issues without interaction for more than 14 days (2 weeks), may be closed at our discretion. We do this, as sometimes issues are abandoned. We may at our discretion, add issues to the relevant project to be looked at, or for maintainers to work through as time permits. This is to help keep issues relevant to the current version of Summernote, and to reduce clutter.
- [x] I agree to follow the Code of Conduct that this project adheres to.
Steps to reproduce
When using fonts with spaces in their names (such as "Times New Roman") in Summernote (using summernote-lite.js), the resulting HTML contains malformed style attributes due to incorrect encoding of quotation marks. This results in broken markup where the font-family style is not applied correctly.
Steps to Reproduce:
-
Open Summernote (using summernote-lite.js) in your application.
-
Select a font that includes spaces in its name, for example "Times New Roman".
-
Type some text and apply the font.
-
Save or inspect the HTML output.
Notice that the generated HTML has a style attribute like:
style="font-family: "Times New Roman";"
Expected behavior
The saved HTML should render correctly with a properly formatted font-family attribute. For example: Your text here
exemplo html:
FERRAGENS:
FERRAGENS:
Current behavior
The HTML output contains malformed markup due to extra attributes and incorrect quoting. This results in the browser not applying the intended font correctly.
Additional Notes: I attempted to adjust the fontNames and fontNamesIgnoreCheck configuration by adding extra quotes (e.g., ""Times New Roman""), but the issue persists.
Any help or suggestions to resolve this issue would be greatly appreciated. Thank you!
Minimal example reproducing the issue
No response
Environment
Environment:
Summernote Version: (specify the version you are using)
Browser: (Chrome 134)
Operating System: (macOS)