Skip to content

not properly formatting if and nested if #13

@Monkey-yk23

Description

@Monkey-yk23

hello the syntax highlighter is a life saver! but i noticed various issue if inside the markup i add some nested if and else like this
@change="
if ($event.target.checked) {
if (!formData[formGroup.id][element.id]) {
formData[formGroup.id][element.id] = [];
}
formData[formGroup.id][element.id].push(option.value);
} else {
formData[formGroup.id][element.id] = formData[formGroup.id][element.id].filter(val => val !== option.value);
}
"
it affect the rest of the lines changing color and highlight not closed tag( but they are closed)
while the same but less readable statement in ternary operator
@change="
formData[formGroup.id][element.id] = $event.target.checked
? [...(formData[formGroup.id][element.id] || []), option.value]
: formData[formGroup.id][element.id].filter(val => val !== option.value);
"
doesn't affect the whole highlighting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions