Last active
February 7, 2020 14:53
-
-
Save sylvaincombes/1cda1d94ac2ebc587ba1aabc91ed8bbe to your computer and use it in GitHub Desktop.
Ckeditor : Allow and preserve twig syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Allow and preserve twig syntax @see http://stackoverflow.com/questions/20977910/editing-twig-templates-in-ckeditor | |
// Can also be coupled with this plugin : http://ckeditor.com/addon/showprotected | |
CKEDITOR.config.protectedSource.push(/\{\{[\s\S]*?\}\}/g); | |
CKEDITOR.config.protectedSource.push(/\{\%[\s\S]*?%\}/g); | |
CKEDITOR.config.protectedSource.push(/\{\#[\s\S]*?#\}/g); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment