Skip to content

Commit

Permalink
Merge pull request #736 from pillar-markup/fixingReplaceParentTest
Browse files Browse the repository at this point in the history
fixing replace
  • Loading branch information
Ducasse authored May 13, 2024
2 parents 50cbda3 + 732442a commit 5dd1045
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Microdown-Tests/MicrodownTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ MicrodownTest >> testParentLinkIsKeptOnReplaceBy [
new := MicTextBlock new.
new bodyString: 'New'.

self halt.
original replaceBy: new.
self assert: h children size equals: 1.
self assert: h children first equals: new.
Expand Down
5 changes: 1 addition & 4 deletions src/Microdown/MicElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ MicElement >> replaceBy: aMicElement [
Make sure that the new element parent is the parent of the receiver."

parent replace: self by: aMicElement.
"We use basicParent and not parent,
because parent is doing an addChild:"
aMicElement basicParent: parent.
parent := nil.

]

{ #category : 'public' }
Expand Down

0 comments on commit 5dd1045

Please sign in to comment.