Skip to content

Commit

Permalink
Merge pull request #96 from demike/fix/mermaid_escaping
Browse files Browse the repository at this point in the history
fix: mermaid escaping
  • Loading branch information
demike authored Dec 17, 2024
2 parents 93ca4d2 + 1635d93 commit 97de184
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/renderer/mermaid-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ export class MermaidTemplate implements Template {

// utility functions
function escapeMermaid(str: string) {
return str.replace(/[<>]/g,'~')
return str.replace(/[<>]/g,'~').replace('{',"#123;").replace('}',"#125;");
}
4 changes: 2 additions & 2 deletions src/demo/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface Magic {

export type MagicDurability = {
fire: number;
water: number
water: number;
}

export type Durable = {
Expand Down Expand Up @@ -50,4 +50,4 @@ export interface Attribute<T = any> {
export default interface Mountable<T = any> {
mount(): void;
unmount(): void;
}
}
1 change: 1 addition & 0 deletions src/demo/ninja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class Ninja {

public gender: Gender = Gender.Else;
public static IdCnt=0;
position: {x: number, y: number} = {x: 0, y: 0};
private _weapon: Weapon;
protected secondaryWeapon?: Weapon;
private blockade?: Blockade; // private interface test
Expand Down

0 comments on commit 97de184

Please sign in to comment.