fix(editor): Fix resolvable highlighting for HTML editor (#5379)

🐛 Fix resolvable highlighting for HTML editor
This commit is contained in:
Iván Ovejero 2023-02-06 16:29:10 +01:00 committed by GitHub
parent 9a7f3da4a3
commit 31130d5257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,15 +95,15 @@ export const expressionManager = mixins(workflowHelpers).extend({
return rawSegments.reduce<Segment[]>((acc, segment) => {
const { from, to, text, token } = segment;
if (token === 'Plaintext') {
acc.push({ kind: 'plaintext', from, to, plaintext: text });
if (token === 'Resolvable') {
const { resolved, error, fullError } = this.resolve(text, this.hoveringItem);
acc.push({ kind: 'resolvable', from, to, resolvable: text, resolved, error, fullError });
return acc;
}
const { resolved, error, fullError } = this.resolve(text, this.hoveringItem);
acc.push({ kind: 'resolvable', from, to, resolvable: text, resolved, error, fullError });
acc.push({ kind: 'plaintext', from, to, plaintext: text });
return acc;
}, []);