NEW Markdown Editor Extension, but need Javascript help
This is an open discussion with 2 replies, filed under Extensions.
Search
You are trying to select an element before the DOM is ready. Replace your publish.js
with
jQuery(document).ready(function() { var editor = new Editor({element: jQuery.find('textarea[class*=markdown]')[0]}); editor.render(); });
and it works perfectly.
Thanks @phoque! I am going to move this thread to the new extension thread.
Create an account or sign in to comment.
I am trying to pull together a new Markdown Editor extension using the beautiful "Editor" Markdown editor (Github) by Hsiaoming Yang at lab.lepture.com.
Here's my Github repo for the extension, I am trying to put together. I am able to install OK on Symphony 2.3.x, but I keep running across the following Javascript issue...
Uncaught TypeError: Cannot read property 'value' of undefined.
on line 3548 of editor.js / also see publish.js ... that could be part of the problem.Would anyone be willing to fork this extension and see if they could help figure out how to fix this? I think this would be an awesome editor to add to our existing Markdown editors for Symphony.
Unfortunately, my Javascript skills are pretty sad. Would love to get some help if that's possible. Thanks for your time in advance.