Skip to content

Commit ac53cee

Browse files
committed
Add possible rawParagraph rendering and an Environment test
1 parent 87b595d commit ac53cee

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/Microdown-HTMLExporter/MicHTMLVisitor.class.st

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,19 @@ MicHTMLVisitor >> visitQuote: aQuote [
474474
with: [ super visitQuote: aQuote ]
475475
]
476476

477+
{ #category : 'visiting - html extensions' }
478+
MicHTMLVisitor >> visitRawParagraph: aParagraph [
479+
480+
canvas
481+
newLine;
482+
raw: '<' , aParagraph label , '>';
483+
raw: (aParagraph body
484+
ifNil: [ '' ]
485+
ifNotNil: [ canvas newLine. ^ aParagraph body ]);
486+
newLine;
487+
raw: aParagraph lineStopMarkup
488+
]
489+
477490
{ #category : 'visiting - inline elements' }
478491
MicHTMLVisitor >> visitStrike: aStrike [
479492

src/Microdown-Tests/MicEnvironmentBlockTest.class.st

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,29 @@ environment, else we force writer to enter a new line to declare the end of
294294
the paragraph.'.
295295
]
296296

297+
{ #category : 'tests' }
298+
MicEnvironmentBlockTest >> testEnvironmentWithSameNestedElementAsParent [
299+
"'<?slide
300+
<?slide
301+
?>
302+
?>
303+
'"
304+
305+
| source root env environmentName |
306+
environmentName := 'slide'.
307+
source := EnvironmentOpeningBlockMarkup , environmentName , String cr
308+
, EnvironmentOpeningBlockMarkup , environmentName
309+
, String cr , EnvironmentClosingBlockMarkup , String cr
310+
, EnvironmentClosingBlockMarkup , String cr.
311+
root := parser parse: source.
312+
313+
self assert: root children size equals: 1.
314+
env := root children first.
315+
self assert: (env isKindOf: MicSlideBlock).
316+
317+
self assert: env children first class equals: MicSlideBlock
318+
]
319+
297320
{ #category : 'tests - extensions' }
298321
MicEnvironmentBlockTest >> testExtensionClassWithSpaceAndArgIsCreated [
299322

0 commit comments

Comments
 (0)