Skip to content

Commit

Permalink
fixes test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
panoply committed Sep 28, 2022
1 parent 76c45ea commit 2823e36
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/beautify/markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,14 @@ prettify.beautify.markup = (options: Options) => {

const lang = options.language;
const id = is(data.token[a], cc.LCB) ? 'liquid' : 'html';
const isjson = grammar[id].embed[data.stack[a]].language === 'json';
let isjson = false;

if (isjson) options.language = 'json';
if (
id === 'liquid' &&
data.stack[a] in grammar[id].embed &&
'language' in grammar[id].embed[data.stack[a]]) {
isjson = grammar[id].embed[data.stack[a]].language === 'json';
}

embedded = prettify.beautify[data.lexer[a]](options).replace(StripEnd, NIL);

Expand Down

0 comments on commit 2823e36

Please sign in to comment.