Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich Text: Eliminate second scan when getting text content (#43207)
When calling `getTextContent()` on a `RichTextValue` we have to make sure we replace any internal-use placeholder values. Previously we've been making two string-replace passes with a new `RegExp` on each call to `getTextContext()`. In this patch we're combining the things we want to replace into a single `RegExp` pattern so that we can make both existing substitutions in one pass through the text instead of two, and we're pre-allocating that `RegExp` at module boot time so we can avoid creating new instances of it on every call.
- Loading branch information