Comments (6)
On your browser, open developer tools and check the console.
You might be getting an error as:
Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('cke_source cke_reset cke_enable_context_menu') contains HTML space characters, which are not valid in tokens.
Go to your project>ckeditor>plugins>markdown>plugin.js:
search for "textarea.addClass('cke_source cke_reset cke_enable_context_menu');"
If you found the same. Replace this with:
"textarea.addClass('cke_source','cke_reset','cke_enable_context_menu');"
from ckeditor-markdown-plugin.
more details :
error :
Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('cke_source cke_reset cke_enable_context_menu') contains HTML space characters, which are not valid in tokens.
I succeed to debug, you have to replace html chars I suppose something like htmlentyties :
in ckeditor.js
var e = document.createElement("_").classList
, e = "undefined" !== typeof e && null !== String(e.add).match(/\[Native code\]/gi)
, g = /[\n\t\r]/g;
CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
type: CKEDITOR.NODE_ELEMENT,
addClass: e ? function(a) {
/* hereis the problem, I don't know if you are supposed to explode with spaces and
* add one by one or if just replace spaces with '+'
*/
this.$.classList.add(a);
return this
}
from ckeditor-markdown-plugin.
I'm in the same boat. However, after some playing around with the code I finally got it to work. Here's what I had to do:
- Download the "basic" CKEditor download. (Don't select to download the markdown module from ckeditor.com as it's currently broken and not maintained there)
- Clone the code from this repository to my local machine and copy the markdown folder to my CKEditor's plugins directory.
- Add extraPlugins : 'markdown' to my CKEditor's replace function (or config.js file)
Now, after this I got a different error. Something about calling maximize.modes where maximize was undefined (stems from an error in the plugin.js file within this repository). I fixed the plugin.js file and the error went away and I was able to get markdown to work. You can find the plugin.js file under this pull request I submitted: dancinllama@d8b7ef4
Last, if you're a glutton for punishment, you can try to fix the error manually by doing the following:
In ckeditor.js (around line 2291 when I pretty print it), there is a function that adds css classes and looks like the following: (@leokun calls this out too)
addClass: e ? function(a) { this.$.classList.add(a); return this }
For whatever reason, it bombs when trying to add multiple classes. This can be fixed with the following:
addClass: e ? function(a) { var strArr = a.split(' '); for(var strArrIdx = 0; strArrIdx < strArr.length; strArrIdx = strArrIdx + 1){ this.$.classList.add(strArr[strARrIdx]); } return this; }
This seems to be more of a bug in the ckeditor.js though than in the markdown plugin.
Hope that helps other folks having the same issue!
from ckeditor-markdown-plugin.
Hello Developers,
I have the same problem with Ckeditor 4.6.2. When I click the button Markdown, I can not write in the editor. The button can not be deactivated.
Can you eliminate this or what do I have to do so that Markdown works?
Thanks in advance.
from ckeditor-markdown-plugin.
Hey guys,I have debuged this problem sucessfully and thanks a lot with @dancinllama.the fixed can be worked very well with ckeditor 4.6.2
so this is the correct step:
- download the ckeditor 4.6.2 from ckeditor.com
2.chose the customize and online builder to download.
3.add ckeditor standard,add the markdown plugins to it,chose kama skin(avoid some strange questions),chose language and down the zip file
4.add the ckedior directive to you static directive and add the extraplugins with markdown in config.js
5.edit your ckeditor.js with this:
fromaddClass: e ? function(a) { this.$.classList.add(a); return this }
to
addClass: e ? function(a) { var strArr = a.split(' '); for(var strArrIdx = 0; strArrIdx < strArr.length; strArrIdx = strArrIdx + 1){ this.$.classList.add(strArr[strARrIdx]); } return this; }
note:split(' ') there must be a space between ' '
it is done.I hope someone test this .in my app ,it is worked very good,and I am tired to test it again.
from ckeditor-markdown-plugin.
mukarramali's solution solved it for me :) thank you!
from ckeditor-markdown-plugin.
Related Issues (20)
- removes comments
- Markdown button does not show up, only Source button HOT 4
- There is no obvious way to create a table for non-tec users. HOT 1
- InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('cke_source cke_reset cke_enable_context_menu') HOT 3
- Markdown Button is not loaded in inline editor HOT 1
- issue regarding the coding structure of markdown
- depending on maximize
- mixing the style
- The demo doesn't work on Android with Chrome HOT 1
- Saving/Updating From Markdown HOT 2
- What about the design code?
- Break lines of the text HOT 1
- Content is editable for disabled textarea HOT 1
- Markdown empty after pasting date in wysiwyg mode HOT 1
- Markdown plugin does not work HOT 1
- markdown format save error
- How to Wrap the text in Markdown View of CKEditor? HOT 2
- Ck 4.0编写Code的反引号在取消markdown编辑后没有<pre><code>元素包裹
- when used mathjax ,then switch markdown mode,and then switch back, mathjax will missing '\'
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 ckeditor-markdown-plugin.