Показаны сообщения с ярлыком ckeditor. Показать все сообщения
Показаны сообщения с ярлыком ckeditor. Показать все сообщения

среда, 30 января 2019 г.

[Ckeditor] adds extra

html tags fix

If you pass HTML content to Twig template and escape it with raw filter/function, and get extra <p> tags, like in this example:

<p></p>
<p>my passed HTML content from CKeditor</p>
<p></p>

It means you should unwrap <p> tag, which wraps Twig content variable.
Bad Twig case:

<p>{{ page.content|raw }}</p>

Good Twig case:
{{ page.content|raw }}

It occurs because <p> cannot be nested, so tag cannot be unclosed, and if at next opens a new <p>, previous tag becomes automatically closed. 

вторник, 10 января 2017 г.

CKEditor + Symfony - Cannot read property 'icons'

Be sure in config.yml in "extraPlugins" plugin name is the same as in specified plugin's file plugin.js first row, for example: "CKEDITOR.plugins.add( 'filepreview', {", where 'filepreview' is config.yml's plugin name.