Slightly nicer embedded-value printing

This commit is contained in:
Tony Garnock-Jones 2021-12-09 18:34:54 +01:00
parent 43f31b9a78
commit f2d9b68329
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,11 @@ export class Embedded<T> {
}
asPreservesText(): string {
return '#!' + (this.embeddedValue as any).asPreservesText();
try {
return '#!' + (this.embeddedValue as any).asPreservesText();
} catch {
return '#!' + (this.embeddedValue as any).toString();
}
}
}