Liquid integration
Question
Would it be possible to include Liquid syntax highlight in the HTML?
Answers (3)
Hi, if you are talking about HTML displayed when exporting a template then unfortunately there is no way to customize it using the default export template command: https://github.com/artf/grapesjs/blob/dev/src/commands/view/ExportTemplate.js. You can see that CodeMirror's theme is hardcoded to 'hopscotch' in there. But, you can create your own export template command and override the default one and pass desired theme to it in options. You can find example of this in the grapesjs-presetnewsletter project: https://github.com/artf/grapesjs-preset-newsletter/blob/master/src/openExportCommand.js. Then just include custom CodeMirror theme css and it should work.
Sorry, you were talking about the actual language highlighting. I'm not 100% sure about that but probably you need to customize CodeMirror as well. So, I would still take a look at export tempalte command.
@eddyjl077 you can create a new command and initialize another codemirror instance with your options (eg. #209)
Related Questions and Answers
Continue research with similar issue discussions.
Issue #567
A component that inserts editable HTML
Would it be possible to create a block that allowed the user to write in responsive HTML either directly on to the template or on the side...
Issue #1393
[Question] Add grapesjs color picker to a new trait type?
I'm building a a new trait type, and would like to be able to include the grapesjs color picker inside it - any suggestions on how to do th...
Issue #908
[FEATURE REQUEST] Add custom classes to panels and other editor elements
When using a UI framework that provides custom classes, it would be nice to be able to use these classes on things like panels, so you woul...
Issue #491
Asset Manager replacement
Is it possible to replace the asset manager with something completely different (such as CKFinder - https://ckeditor.com/ckeditor-4/ckfinde...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.