11

I am creating a form with symfony. One field of my form is an textarea that I want to make it look better through the use of the bootstrap-markdown. According to the documentation, I set the attribute 'data-provide' to 'markdown' as it is shown below:

{{ form_row(form.description,
            { 'attr': {'data-provide': 'markdown'} }) }}

Until this point, all the buttons of the editor are working. But the preview button is not working!

Is there any idea to solve that issue?

Is that jQuery code necessary for making the preview buttons working?

$( document ).ready(function() {
    $("#MotorsAdsCreate_description").markdown({autofocus:false,savable:false});
});

Thanks for your help;

Amine Jallouli
  • 3,919
  • 8
  • 36
  • 73

1 Answers1

41

I found the solution.

You just need to add the following js files.

The documentation did not mention to add these files explicitly!

Hope this would help...

Amine Jallouli
  • 3,919
  • 8
  • 36
  • 73
  • It is written here www.codingdrama.com/bootstrap-markdown/ on a bottom of site. "...The preview functionalities and html to markdown conversion are provided by 3rd party codes : markdown-js, marked (default failover if markdown-js lib not available) and to-markdown. Without them, this plugin would still work and convert the content as-is, so you could easily modify those functionalities yourself via available hooks..." – Matěj Kříž Jul 29 '15 at 11:56
  • @amine jallouli - is there any way to browse images from the server using the bootstrap markdown editor from codingdrama.com – Suleman khan Feb 12 '16 at 18:55
  • @aminejallouli - could you please tell me how can I upload images in the editor ? I have put this question http://stackoverflow.com/questions/35439199/how-to-integrate-dropzone-in-bootstrap-markdown-editor if you can answer it.. Thanks – Suleman khan Feb 17 '16 at 15:20