Search

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.

Javascript Error

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.

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details