Skip to content

Commit

Permalink
Unescape text used in labels
Browse files Browse the repository at this point in the history
Fixes #45
Fixes #43
  • Loading branch information
theacodes committed Nov 3, 2023
1 parent 5cd3c31 commit b5970f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/kicad/schematic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Stroke,
TitleBlock,
expand_text_vars,
unescape_string,
} from "./common";
import { P, T, parse_expr, type Parseable } from "./parser";

Expand Down Expand Up @@ -685,6 +686,10 @@ export class Label {
P.atom("fields_autoplaced"),
P.pair("uuid", T.string),
];

get shown_text() {
return unescape_string(this.text);
}
}

export class NetLabel extends Label {
Expand Down
2 changes: 1 addition & 1 deletion src/viewers/schematic/painters/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class LabelPainter extends SchematicItemPainter {
return;
}

const schtext = new SchText(l.text);
const schtext = new SchText(l.shown_text);
schtext.apply_at(l.at);
schtext.apply_effects(l.effects);

Expand Down

0 comments on commit b5970f9

Please sign in to comment.