Issue #877💬 AnsweredOpened February 16, 2018by eddyjl0770 reactions

Liquid integration

快速解答by maxtacco

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. Bu...

Read full answer below ↓

Question

Would it be possible to include Liquid syntax highlight in the HTML?

Answers (3)

maxtaccoFebruary 16, 2018

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.

maxtaccoFebruary 16, 2018

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.

artfFebruary 27, 2018

@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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.