Skip to content

Commit

Permalink
fixing replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed May 13, 2024
1 parent 50cbda3 commit 732442a
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 732442a

Please sign in to comment.