Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…pesjs into bernesto-dev
  • Loading branch information
artf committed May 23, 2024
2 parents a7d4942 + a424617 commit 1cf74c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/commands/view/ShowOffset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default {
const zoom = this.em.getZoomDecimal();
const el = opt.el as HTMLElement | undefined;

if (!(el instanceof HTMLElement)) {
return;
}

if (!config.showOffsets || !el || isTextNode(el) || (!config.showOffsetsSelected && state == 'Fixed')) {
editor.stopCommand(`${this.id}`, opts);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/selector_manager/model/Selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default class Selector extends Model<SelectorProps & { [key: string]: unk
* @private
*/
static escapeName(name: string) {
return `${name}`.trim().replace(/([^a-z0-9\w-\\:@\\/]+)/gi, '-');
return `${name}`.trim().replace(/([^a-z0-9\w\-\\:@\\/()\.%\+\[\]]+)/gi, '-');
}
}

Expand Down

0 comments on commit 1cf74c1

Please sign in to comment.