From f52364f2d0d027aba631db7e4447415cb867ba02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Mon, 29 Apr 2024 20:46:37 +0200 Subject: [PATCH 1/6] Verifying replaceby maintain invariant --- .../MicBeamerWriterTest.class.st | 31 ++++++++++--------- .../MicMicrodownToSlideTest.class.st | 22 +++++++++++++ src/Microdown-BeamerExporter-Tests/package.st | 2 +- .../MicBeamerWriter.class.st | 31 ++++++++++--------- .../MicMicrodownToSlideVisitor.class.st | 13 ++++++++ src/Microdown-BeamerExporter/package.st | 2 +- src/Microdown-Tests/MicrodownTest.class.st | 20 ++++++++++++ src/Microdown/MicAbstractBlock.class.st | 7 +---- src/Microdown/MicElement.class.st | 12 +++++++ src/Microdown/MicEvaluatedBlock.class.st | 6 ++++ src/Microdown/MicSlideBlock.class.st | 8 +++++ 11 files changed, 116 insertions(+), 38 deletions(-) create mode 100644 src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st create mode 100644 src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st diff --git a/src/Microdown-BeamerExporter-Tests/MicBeamerWriterTest.class.st b/src/Microdown-BeamerExporter-Tests/MicBeamerWriterTest.class.st index f1665b01..a57b5139 100644 --- a/src/Microdown-BeamerExporter-Tests/MicBeamerWriterTest.class.st +++ b/src/Microdown-BeamerExporter-Tests/MicBeamerWriterTest.class.st @@ -1,10 +1,11 @@ Class { - #name : #MicBeamerWriterTest, - #superclass : #MicLaTeXWriterTest, - #category : #'Microdown-BeamerExporter-Tests' + #name : 'MicBeamerWriterTest', + #superclass : 'MicLaTeXWriterTest', + #category : 'Microdown-BeamerExporter-Tests', + #package : 'Microdown-BeamerExporter-Tests' } -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest class >> testParameters [ ^ ParametrizedTestMatrix new @@ -15,12 +16,12 @@ MicBeamerWriterTest class >> testParameters [ yourself ] -{ #category : #running } +{ #category : 'running' } MicBeamerWriterTest >> actualClass [ ^ MicBeamerWriter ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testCode [ self writeFor: (factory codeblockNoParamBody: 'this is a code'). @@ -29,7 +30,7 @@ MicBeamerWriterTest >> testCode [ '\end{listing}', newLine ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testCodeWithCaption [ self writeFor: (factory codeblock: 'caption=Pharo is **cool**' body: 'this is a code'). @@ -38,7 +39,7 @@ MicBeamerWriterTest >> testCodeWithCaption [ '\end{listing}', newLine ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testCodeWithLabel [ self writeFor: (factory codeblock: 'label=Pharo' body: 'this is a code'). @@ -47,7 +48,7 @@ MicBeamerWriterTest >> testCodeWithLabel [ '\end{listing}', newLine ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testColumn [ self writeFor: (factory columnSample). @@ -56,7 +57,7 @@ MicBeamerWriterTest >> testColumn [ '\end{column}', newLine, newLine ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testColumns [ self writeFor: (factory columnsSample). @@ -64,7 +65,7 @@ MicBeamerWriterTest >> testColumns [ '\end{columns}', newLine , newLine ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testColumnsWithChildren [ self writeFor: factory columnsWithChildrenSample. @@ -78,7 +79,7 @@ MicBeamerWriterTest >> testColumnsWithChildren [ '\end{columns}', newLine , newLine ] -{ #category : #'tests - figure/link' } +{ #category : 'tests - figure/link' } MicBeamerWriterTest >> testFigure [ self writeFor: factory figureSample. @@ -87,7 +88,7 @@ MicBeamerWriterTest >> testFigure [ '\includegraphics[width=0.8\textwidth]{/anUrl}\end{center}', newLine, newLine ] -{ #category : #'tests - figure/link' } +{ #category : 'tests - figure/link' } MicBeamerWriterTest >> testFigureBold [ "in beamer we do not display caption so bld and the rest goes away." self writeFor: factory figureBoldSample. @@ -96,7 +97,7 @@ MicBeamerWriterTest >> testFigureBold [ '\includegraphics[width=0.8\textwidth]{/anUrl}\end{center}', newLine , newLine ] -{ #category : #'tests - figure/link' } +{ #category : 'tests - figure/link' } MicBeamerWriterTest >> testFigureRealSample [ self writeFor: factory figureRealSample. @@ -105,7 +106,7 @@ MicBeamerWriterTest >> testFigureRealSample [ '\includegraphics[width=0.8\textwidth]{figures/logo.png}\end{center}', newLine , newLine ] -{ #category : #tests } +{ #category : 'tests' } MicBeamerWriterTest >> testFrameWithoutOption [ self diff --git a/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st b/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st new file mode 100644 index 00000000..6c337472 --- /dev/null +++ b/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st @@ -0,0 +1,22 @@ +Class { + #name : 'MicMicrodownToSlideTest', + #superclass : 'TestCase', + #category : 'Microdown-BeamerExporter-Tests', + #package : 'Microdown-BeamerExporter-Tests' +} + +{ #category : 'tests' } +MicMicrodownToSlideTest >> testSectionLevelOneIsMapToSlide [ + + | doc | + doc := MicrodownParser new parse: '# Slide title + +- item 1 +- item 2 +'. + MicMicrodownToSlideVisitor new visit: doc. + self assert: doc children first class equals: MicSlideBlock. + self assert: doc children second class equals: MicUnorderedListBlock. + + +] diff --git a/src/Microdown-BeamerExporter-Tests/package.st b/src/Microdown-BeamerExporter-Tests/package.st index 9f918ba2..1a7874ca 100644 --- a/src/Microdown-BeamerExporter-Tests/package.st +++ b/src/Microdown-BeamerExporter-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-BeamerExporter-Tests' } +Package { #name : 'Microdown-BeamerExporter-Tests' } diff --git a/src/Microdown-BeamerExporter/MicBeamerWriter.class.st b/src/Microdown-BeamerExporter/MicBeamerWriter.class.st index 9e645527..4f672c20 100644 --- a/src/Microdown-BeamerExporter/MicBeamerWriter.class.st +++ b/src/Microdown-BeamerExporter/MicBeamerWriter.class.st @@ -47,12 +47,13 @@ Metacello new ``` " Class { - #name : #MicBeamerWriter, - #superclass : #MicLaTeXWriter, - #category : #'Microdown-BeamerExporter' + #name : 'MicBeamerWriter', + #superclass : 'MicLaTeXWriter', + #category : 'Microdown-BeamerExporter', + #package : 'Microdown-BeamerExporter' } -{ #category : #'basic ressources' } +{ #category : 'basic ressources' } MicBeamerWriter class >> basicTemplateForTest [ ^ '% -*- mode: latex; -*- mustache tags: {{=« »=}} «! the ''&'' below prevents HTML escaping. » @@ -111,20 +112,20 @@ MicBeamerWriter class >> basicTemplateForTest [ \end{document}' ] -{ #category : #accessing } +{ #category : 'accessing' } MicBeamerWriter class >> writerName [ ^ #micBeamer ] -{ #category : #helpers } +{ #category : 'helpers' } MicBeamerWriter >> createFrametitle: aTitle [ canvas command name: 'frametitle'; parameter: aTitle ] -{ #category : #helpers } +{ #category : 'helpers' } MicBeamerWriter >> createLinkToLabelWithAlias: anInternalLink [ canvas command name: 'hyperlink'; @@ -132,12 +133,12 @@ MicBeamerWriter >> createLinkToLabelWithAlias: anInternalLink [ parameter: [ canvas raw: anInternalLink alias ] ] -{ #category : #accessing } +{ #category : 'accessing' } MicBeamerWriter >> folderName [ ^ #beamer ] -{ #category : #helpers } +{ #category : 'helpers' } MicBeamerWriter >> sectionOptionFrom: level To: depth On: parameters [ parameters add: @@ -156,12 +157,12 @@ MicBeamerWriter >> sectionOptionFrom: level To: depth On: parameters [ ifFalse: [ 'subsubsectionstyle=hide/hide/hide' ]) ] -{ #category : #accessing } +{ #category : 'accessing' } MicBeamerWriter >> templateForConfiguration: aConfiguration [ ^ 'presentation.template' ] -{ #category : #'blocks - code' } +{ #category : 'blocks - code' } MicBeamerWriter >> visitCode: aCodeBlock [ | env | env := (aCodeBlock hasCaption and: [ aCodeBlock hasLabel ]) @@ -192,7 +193,7 @@ MicBeamerWriter >> visitCode: aCodeBlock [ env with: [ canvas nextPutAllLines: aCodeBlock body. canvas newLine ] ] -{ #category : #visiting } +{ #category : 'visiting' } MicBeamerWriter >> visitColumn: aColumn [ canvas environment name: 'column'; @@ -204,7 +205,7 @@ MicBeamerWriter >> visitColumn: aColumn [ canvas newLine ] -{ #category : #visiting } +{ #category : 'visiting' } MicBeamerWriter >> visitColumns: aColumns [ canvas environment name: 'columns'; @@ -213,14 +214,14 @@ MicBeamerWriter >> visitColumns: aColumns [ canvas newLine ] -{ #category : #'blocks - inline' } +{ #category : 'blocks - inline' } MicBeamerWriter >> visitFigure: aFigure [ canvas environment name: 'center'; with: [ self includeGraphicsFor: aFigure ] ] -{ #category : #'visiting - extensions' } +{ #category : 'visiting - extensions' } MicBeamerWriter >> visitSlide: aSlide [ canvas newLine. canvas environment diff --git a/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st b/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st new file mode 100644 index 00000000..397b5c89 --- /dev/null +++ b/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st @@ -0,0 +1,13 @@ +Class { + #name : 'MicMicrodownToSlideVisitor', + #superclass : 'MicrodownVisitor', + #category : 'Microdown-BeamerExporter', + #package : 'Microdown-BeamerExporter' +} + +{ #category : 'visiting' } +MicMicrodownToSlideVisitor >> visitHeader: aHeader [ + + aHeader level = 1 + ifTrue: [ aHeader parent ] +] diff --git a/src/Microdown-BeamerExporter/package.st b/src/Microdown-BeamerExporter/package.st index 83e25826..69755e11 100644 --- a/src/Microdown-BeamerExporter/package.st +++ b/src/Microdown-BeamerExporter/package.st @@ -1 +1 @@ -Package { #name : #'Microdown-BeamerExporter' } +Package { #name : 'Microdown-BeamerExporter' } diff --git a/src/Microdown-Tests/MicrodownTest.class.st b/src/Microdown-Tests/MicrodownTest.class.st index 6165f884..874db2d9 100644 --- a/src/Microdown-Tests/MicrodownTest.class.st +++ b/src/Microdown-Tests/MicrodownTest.class.st @@ -77,3 +77,23 @@ MicrodownTest >> testParentBackLinkIsSet [ self assert: h children first equals: t. self assert: t parent equals: h ] + +{ #category : 'tests - replace' } +MicrodownTest >> testParentLinkIsKeptOnReplaceBy [ + + | h original new | + h := MicHeaderBlock new. + original := MicTextBlock new. + original bodyString: 'Original'. + original parent: h. + self assert: original parent equals: h. + self assert: h children first equals: original. + new := MicTextBlock new. + new bodyString: 'New'. + + original replaceBy: new. + self assert: h children size equals: 1. + self assert: h children first equals: new. + self assert: new parent equals: h. + +] diff --git a/src/Microdown/MicAbstractBlock.class.st b/src/Microdown/MicAbstractBlock.class.st index 5a774b05..be4fdd65 100644 --- a/src/Microdown/MicAbstractBlock.class.st +++ b/src/Microdown/MicAbstractBlock.class.st @@ -135,7 +135,7 @@ MicAbstractBlock >> parserClass [ { #category : 'replacement' } MicAbstractBlock >> replace: aBlock by: anotherBlock [ - children replaceAll: aBlock with: anotherBlock + self children replaceAll: aBlock with: anotherBlock ] { #category : 'replacement' } @@ -144,11 +144,6 @@ MicAbstractBlock >> replace: aBlock byCollection: aCollection [ children := children copyReplaceAll: {aBlock} with: aCollection ] -{ #category : 'replacement' } -MicAbstractBlock >> replaceBy: anotherBlock [ - self parent replace: self by: anotherBlock -] - { #category : 'replacement' } MicAbstractBlock >> replaceByAll: aCollection [ self parent replace: self byCollection: aCollection diff --git a/src/Microdown/MicElement.class.st b/src/Microdown/MicElement.class.st index 00c65d78..5b6aa89c 100644 --- a/src/Microdown/MicElement.class.st +++ b/src/Microdown/MicElement.class.st @@ -151,6 +151,18 @@ MicElement >> removeProperty: aKey ifAbsent: aBlock [ ^ answer ] +{ #category : 'replacement' } +MicElement >> replaceBy: anotherBlock [ + "Replace the receiver by the argument. + Make sure that the new element parent is the parent of the receiver." + + parent replace: self by: anotherBlock. + "We use basicParent and not parent, + because parent is doing an addChild:" + anotherBlock basicParent: parent. + parent := nil. +] + { #category : 'public' } MicElement >> resolveFrom: aBase [ Microdown resolveDocument: self withBase: aBase diff --git a/src/Microdown/MicEvaluatedBlock.class.st b/src/Microdown/MicEvaluatedBlock.class.st index f1e38dda..97fcb2a6 100644 --- a/src/Microdown/MicEvaluatedBlock.class.st +++ b/src/Microdown/MicEvaluatedBlock.class.st @@ -47,6 +47,12 @@ MicEvaluatedBlock >> printOn: stream [ ] +{ #category : 'replacement' } +MicEvaluatedBlock >> replace: aBlock by: anotherBlock [ + + self children replaceAll: aBlock with: anotherBlock +] + { #category : 'accessing' } MicEvaluatedBlock >> textElement [ "Should only be used for tests" diff --git a/src/Microdown/MicSlideBlock.class.st b/src/Microdown/MicSlideBlock.class.st index 577670ed..24570f0b 100644 --- a/src/Microdown/MicSlideBlock.class.st +++ b/src/Microdown/MicSlideBlock.class.st @@ -10,6 +10,8 @@ to have the same slide but on two different layouts and not emit both. - bullet 3 !> ``` + +It should be noted that the title is not reified as a Microdown object because so far the extensions does not support a way to describe the argument that should be reified. " Class { #name : 'MicSlideBlock', @@ -46,3 +48,9 @@ MicSlideBlock >> tag [ MicSlideBlock >> title [ ^ arguments at: 'title' ifAbsent: [ '' ] ] + +{ #category : 'accessing' } +MicSlideBlock >> title: aString [ + + arguments at: #title put: aString +] From 06502d7193888660d749d6841ff22990d9162826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Mon, 13 May 2024 09:16:27 -0400 Subject: [PATCH 2/6] Fix: improve replace:by: to make sure that parent are set (should recover some tests about this behavior) --- .../MicMicrodownToSlideTest.class.st | 23 +++++++++++++++++-- .../MicMicrodownToSlideVisitor.class.st | 4 ++-- src/Microdown/MicAbstractBlock.class.st | 10 ++++---- src/Microdown/MicElement.class.st | 6 ++--- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st b/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st index 6c337472..627bd059 100644 --- a/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st +++ b/src/Microdown-BeamerExporter-Tests/MicMicrodownToSlideTest.class.st @@ -8,15 +8,34 @@ Class { { #category : 'tests' } MicMicrodownToSlideTest >> testSectionLevelOneIsMapToSlide [ - | doc | + | doc slide | doc := MicrodownParser new parse: '# Slide title - item 1 - item 2 '. MicMicrodownToSlideVisitor new visit: doc. - self assert: doc children first class equals: MicSlideBlock. + slide := doc children first. + self assert: slide class equals: MicSlideBlock. + self assert: slide title equals: 'Slide title'. self assert: doc children second class equals: MicUnorderedListBlock. ] + +{ #category : 'tests' } +MicMicrodownToSlideTest >> testSlideGotCorrectParent [ + + | doc slide | + doc := MicrodownParser new parse: '# Slide title + +- item 1 +- item 2 +'. + self assert: doc children size equals: 2. + MicMicrodownToSlideVisitor new visit: doc. + slide := doc children first. + self assert: slide parent equals: doc. + self assert: doc children size equals: 2 + +] diff --git a/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st b/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st index 397b5c89..73306105 100644 --- a/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st +++ b/src/Microdown-BeamerExporter/MicMicrodownToSlideVisitor.class.st @@ -8,6 +8,6 @@ Class { { #category : 'visiting' } MicMicrodownToSlideVisitor >> visitHeader: aHeader [ - aHeader level = 1 - ifTrue: [ aHeader parent ] + aHeader parent replace: aHeader by: (MicSlideBlock new title: aHeader header) + ] diff --git a/src/Microdown/MicAbstractBlock.class.st b/src/Microdown/MicAbstractBlock.class.st index be4fdd65..3e2a3e2f 100644 --- a/src/Microdown/MicAbstractBlock.class.st +++ b/src/Microdown/MicAbstractBlock.class.st @@ -133,15 +133,17 @@ MicAbstractBlock >> parserClass [ ] { #category : 'replacement' } -MicAbstractBlock >> replace: aBlock by: anotherBlock [ +MicAbstractBlock >> replace: aMicElement by: anotherMicElement [ - self children replaceAll: aBlock with: anotherBlock + self children replaceAll: aMicElement with: anotherMicElement. + aMicElement basicParent: nil. + anotherMicElement basicParent: self. ] { #category : 'replacement' } -MicAbstractBlock >> replace: aBlock byCollection: aCollection [ +MicAbstractBlock >> replace: aMicElement byCollection: aCollection [ - children := children copyReplaceAll: {aBlock} with: aCollection + children := children copyReplaceAll: {aMicElement} with: aCollection ] { #category : 'replacement' } diff --git a/src/Microdown/MicElement.class.st b/src/Microdown/MicElement.class.st index 5b6aa89c..23c3b918 100644 --- a/src/Microdown/MicElement.class.st +++ b/src/Microdown/MicElement.class.st @@ -152,14 +152,14 @@ MicElement >> removeProperty: aKey ifAbsent: aBlock [ ] { #category : 'replacement' } -MicElement >> replaceBy: anotherBlock [ +MicElement >> replaceBy: aMicElement [ "Replace the receiver by the argument. Make sure that the new element parent is the parent of the receiver." - parent replace: self by: anotherBlock. + parent replace: self by: aMicElement. "We use basicParent and not parent, because parent is doing an addChild:" - anotherBlock basicParent: parent. + aMicElement basicParent: parent. parent := nil. ] From 5d94b2ba26fe956107959f3c5686fb250338b296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Mon, 13 May 2024 09:17:07 -0400 Subject: [PATCH 3/6] Fix argument API --- src/Microdown/MicArgumentList.class.st | 15 +++++++++++---- src/Microdown/MicEnvironmentBlock.class.st | 8 ++++++++ src/Microdown/MicHeaderBlock.class.st | 5 +++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Microdown/MicArgumentList.class.st b/src/Microdown/MicArgumentList.class.st index 4d6b245e..7f64ba9d 100644 --- a/src/Microdown/MicArgumentList.class.st +++ b/src/Microdown/MicArgumentList.class.st @@ -58,10 +58,7 @@ MicArgumentList class >> split: aString defaultArg: defArg [ { #category : 'instance creation' } MicArgumentList class >> split: aString defaultArg: defArg defaultValue: defValue [ ^ self new - defaultArg: defArg; - at: defArg put: defValue; - initialValue: defValue; - from: aString; + split: aString defaultArg: defArg defaultValue: defValue; yourself ] @@ -188,6 +185,16 @@ MicArgumentList >> setNoDefaultButArguments: string [ ] +{ #category : 'initialization' } +MicArgumentList >> split: aString defaultArg: defArg defaultValue: defValue [ + + self + defaultArg: defArg; + at: defArg put: defValue; + initialValue: defValue; + from: aString +] + { #category : 'copying' } MicArgumentList >> withoutDefaultValue [ "remove the defaultArg if no new value was assigned to it" diff --git a/src/Microdown/MicEnvironmentBlock.class.st b/src/Microdown/MicEnvironmentBlock.class.st index 1cb64811..ca98bb59 100644 --- a/src/Microdown/MicEnvironmentBlock.class.st +++ b/src/Microdown/MicEnvironmentBlock.class.st @@ -176,6 +176,14 @@ MicEnvironmentBlock >> extractFirstLineFrom: aLine [ ifFalse: [ firstLine ] ] +{ #category : 'parse support' } +MicEnvironmentBlock >> initialize [ + + super initialize. + arguments := MicArgumentList new + +] + { #category : 'markups' } MicEnvironmentBlock >> lineStartMarkup [ diff --git a/src/Microdown/MicHeaderBlock.class.st b/src/Microdown/MicHeaderBlock.class.st index 7966fd66..f9f45ca0 100644 --- a/src/Microdown/MicHeaderBlock.class.st +++ b/src/Microdown/MicHeaderBlock.class.st @@ -56,8 +56,9 @@ MicHeaderBlock >> formattedCode [ { #category : 'accessing' } MicHeaderBlock >> header [ "I am used to get an adhoc string for the header" - ^ String streamContents: [ :s | - children do: [ :e | s nextPutAll: e bodystring ] ] + + ^ String streamContents: [ :s | + children do: [ :e | s nextPutAll: e bodyString ] ] ] { #category : 'accessing' } From 732442ad9b3cb6d5acf26ee624ca9b5baca72303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Mon, 13 May 2024 11:31:23 -0400 Subject: [PATCH 4/6] fixing replace --- src/Microdown-Tests/MicrodownTest.class.st | 1 + src/Microdown/MicElement.class.st | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Microdown-Tests/MicrodownTest.class.st b/src/Microdown-Tests/MicrodownTest.class.st index 874db2d9..c6058110 100644 --- a/src/Microdown-Tests/MicrodownTest.class.st +++ b/src/Microdown-Tests/MicrodownTest.class.st @@ -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. diff --git a/src/Microdown/MicElement.class.st b/src/Microdown/MicElement.class.st index 23c3b918..79ff0df2 100644 --- a/src/Microdown/MicElement.class.st +++ b/src/Microdown/MicElement.class.st @@ -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' } From 28545f9ba28049e606b43462f03bcc4f4a406181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Tue, 14 May 2024 12:43:26 -0400 Subject: [PATCH 5/6] removing halt. --- src/Microdown-Tests/MicrodownTest.class.st | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microdown-Tests/MicrodownTest.class.st b/src/Microdown-Tests/MicrodownTest.class.st index c6058110..874db2d9 100644 --- a/src/Microdown-Tests/MicrodownTest.class.st +++ b/src/Microdown-Tests/MicrodownTest.class.st @@ -91,7 +91,6 @@ 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. From d090e2673760e5891b4359b4b8d8aa8a78912a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Tue, 14 May 2024 12:53:36 -0400 Subject: [PATCH 6/6] Adding Microdown-Blog to the baseline to make sure that it tests --- src/BaselineOfMicrodown/BaselineOfMicrodown.class.st | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st b/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st index 3fe56ceb..6889f573 100644 --- a/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st +++ b/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st @@ -63,6 +63,12 @@ BaselineOfMicrodown >> baseline: spec [ with: [ spec requires: #( #Microdown ) ]; package: #'Microdown-ReferenceChecker' with: [ spec requires: #( #'Microdown' ) ]; + + package: #'Microdown-Blog' with: [ + spec requires: #( #'Microdown' ) ]; + package: #'Microdown-Blog-Tests' with: [ + spec requires: #( #'Microdown-Blog' ) ]; + package: #'Microdown-PrettyPrinter-Tests' with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests' ) ].