Skip to content

Commit

Permalink
fix: Handle liquid inside html
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Jul 12, 2024
1 parent 25420b7 commit a7db697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/skeleton/rules/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {CustomRenderer} from 'src/renderer';
import type {Consumer} from 'src/consumer';
import type {HTMLElement, Node, TextNode} from 'node-html-parser';
import {NodeType, parse} from 'node-html-parser';
import {Liquid} from 'src/skeleton/liquid';
import {token} from 'src/utils';

function isText(node: Node): node is TextNode {
Expand Down Expand Up @@ -138,7 +139,7 @@ export const html: RenderRuleRecord = {

function handleInline(node: Node): Token[] {
if (isText(node)) {
return [token('text', {content: node.innerText})];
return new Liquid(node.innerText).tokenize();
}

if (!node.childNodes.length) {
Expand Down

0 comments on commit a7db697

Please sign in to comment.