From 6131fd8fc6cb1245ccfbc5d03d33ffd1498e83f4 Mon Sep 17 00:00:00 2001 From: alyssaf16 Date: Mon, 8 Jul 2024 15:12:16 -0400 Subject: Speech to phonemes progress --- src/fields/RichTextField.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/fields') diff --git a/src/fields/RichTextField.ts b/src/fields/RichTextField.ts index 3f13f7e6d..613bb0fd1 100644 --- a/src/fields/RichTextField.ts +++ b/src/fields/RichTextField.ts @@ -13,10 +13,15 @@ export class RichTextField extends ObjectField { @serializable(true) readonly Text: string; - constructor(data: string, text: string = '') { + /** + * NOTE: if 'text' doesn't match the plain text of 'data', this can cause infinite loop problems or other artifacts when rendered. + * @param data this is the formatted text representation of the RTF + * @param text this is the plain text of whatever text is in the 'data' + */ + constructor(data: string, text: string) { super(); this.Data = data; - this.Text = text; + this.Text = text; // ideally, we'd compute 'text' from 'data' by doing what Prosemirror does at run-time ... just need to figure out how to write that function accurately } Empty() { -- cgit v1.2.3-70-g09d2