Skip to content

Commit

Permalink
[LVGL] Backslash is not handled properly in Text property #589
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 1, 2024
1 parent fd781c4 commit aee2725
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/project-editor/lvgl/widget-common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ export function escapeCString(unescaped: string) {
result += "\\r";
} else if (ch == "\t") {
result += "\\t";
} else if (
ch == "\\" &&
(i == unescaped.length - 1 ||
(unescaped[i + 1] != "n" &&
unescaped[i + 1] != "r" &&
unescaped[i + 1] != "t" &&
unescaped[i + 1] != "u"))
) {
result += "\\\\";
} else {
result += ch;
}
Expand Down

0 comments on commit aee2725

Please sign in to comment.