-
-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix replacer error on patches with empty Runs #2875
Conversation
Since `Run` already has a option for instantiating a `Text` element, we don't need to push children here.
@@ -77,7 +77,7 @@ export const MOCK_JSON = { | |||
|
|||
describe("replacer", () => { | |||
describe("replacer", () => { | |||
it("should throw an error if nothing is added", () => { | |||
it("should return { didFindOccurrence: false } if nothing is added", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to change the description in PR #2856.
ff0f43e
to
13fee3a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2875 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 286 286
Lines 14366 14359 -7
Branches 1400 1400
=========================================
- Hits 14366 14359 -7 ☔ View full report in Codecov by Sentry. |
Thank you! |
This PR fixes the error in #2855, which occurs because of two minor issues:
TextRun("")
andTextRun({ text: "" })
counterintuitively didn't do the same thing. One creates an innerText
and one doesn't. This PR changesTextRun("")
, so that both always create the inner Text.replacer
didn't handle patches with emptyRun
s. This is also fixed by this PR.