diff options
author | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-07-08 15:12:16 -0400 |
---|---|---|
committer | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-07-08 15:12:16 -0400 |
commit | 6131fd8fc6cb1245ccfbc5d03d33ffd1498e83f4 (patch) | |
tree | 02d802715ae532ab5d2bd2bf422b2e337be44eac /src/fields/RichTextField.ts | |
parent | 20611e69b3f4afca5d35a440278f4dcbbda523c7 (diff) |
Speech to phonemes progress
Diffstat (limited to 'src/fields/RichTextField.ts')
-rw-r--r-- | src/fields/RichTextField.ts | 9 |
1 files changed, 7 insertions, 2 deletions
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() { |