Comments (3)
Interesting. We use the browser to parse, and these are actually the attributes it gives us.
new DOMParser().parseFromString('<i gothic",="" sans-serif;"="">test</i>', 'text/html')
And then getAttributeNames()
on the i
tag returns ['gothic",', 'sans-serif;"']
I'm surprised the browser doesn't strip them, as it is returning names that fail the setAttribute
call. A try/catch there shouldn't strip those attributes, but stripping them does seem like what we should be doing.
from tinymce.
I think there are two issues here:
-
Without the above try catch wrapper the error thrown by setAttribute breaks the script execution in chrome. This prevents tinymce.init() from completing so I just get the three loading dots and no error messages. I've tried using .catch() and wrapping in a try/catch block but I can't prevent execution from breaking.
-
As you discovered, the browser's own parser seems inconsistent when it comes to invalid attributes. It parses it without error via DOMParser but throws an unrecoverable error via setAttribute.
Given that inconsistency I agree tinymce probably needs to strip invalid attributes or find another way to fail gracefully without breaking execution.
Please let me know if i'm missing something obvious in regard to how to catch the error at init time without the execution flow breaking as a temp solution.
from tinymce.
No, you're right, it's something we have to fix in TinyMCE. I can't see any way for you to work around the runtime error without applying regex to the raw source string.
from tinymce.
Related Issues (20)
- placeholder doesn't show on h1 element when using inline editor
- id="title" stripped from element in tinymce 7 HOT 2
- Link/Unlink partial unlinking not working anymore HOT 1
- Add the domain youtube-nocookie.com to the sandbox_iframes_exclusions default value
- Copy-pasted parsed URLs are (incorrectly) URL encoding ampersands HOT 1
- isDirty isn't set when first action removes something from list.
- Dynamically initial selectbox values HOT 1
- Spacebar doesn't always work in Mozilla firefox
- The resize handle icon of status bar is displayed on the left end HOT 1
- Accordions wide gap HOT 3
- Help plugin failed to load HOT 3
- I don't want to display the unit after the font-size, is there any way to do that? HOT 1
- 👍 Padding on Tables Elements doesn't work in some cases. HOT 2
- TinyMCE Version 6 Hyperlink Issue - default_link_target not working HOT 5
- Error: Can't resolve 'node_modules/tinymce/plugins/template/plugin.js' after V7 update HOT 1
- Repeated header/letterhead and footer HOT 1
- multiple files import when we create multiple instances HOT 1
- Implement a fix or flag that lets TinyMCE not alter perfectly legitimate imported code HOT 7
- Initialize right to left attribute issues HOT 1
- React Tinymce Toolbar Sticky not working properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinymce.