froala / KMSFroalaEditorBundle

Symfony bundle for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
105 stars 33 forks source link

Use CodeMirror twig ? #118

Open guldil opened 3 years ago

guldil commented 3 years ago

Hello,

On a symfony 3.4 with KMS Froala 2.9.8 i'm tring to use Twig : https://codemirror.net/mode/twig/index.html

$builder->add('twigContent', FroalaEditorType::class, array('codeMirrorOptions' => array(
                'indentWithTabs' => true,
                'lineNumbers' => true,
                'lineWrapping' => true,
                'mode'=> array('name' => "twig", 'base' => "text/html"),
                'tabMode' => 'indent',
                'tabSize' => 2
            )
            , 'label' => 'Contenu', 'attr' => array('class' => 'froalaMailTransTemplate', 'id' => 'froalaMailTransTemplate'), 'required' => false))

if i remove the code 'mode'=> array('name' => "twig", 'base' => "text/html") it's working i have HTML but no "twig" markup

What did i miss ?

thanks

Guldil