diff --git a/src/MiniDocs/Markdown.class.st b/src/MiniDocs/Markdown.class.st index 6ed9e62..804ed0d 100644 --- a/src/MiniDocs/Markdown.class.st +++ b/src/MiniDocs/Markdown.class.st @@ -29,7 +29,6 @@ Markdown >> asMarkdeep [ { #category : #accessing } Markdown >> asMarkdownTiddler [ - ^ Tiddler new title: self title; text: self contents; @@ -67,12 +66,13 @@ Markdown >> containsYAMLMetadataClosing [ { #category : #accessing } Markdown >> contents [ - | response | + | response metadataString | response := WriteStream on: ''. + metadataString := self metadataAsYAML + ifEmpty: [ '' ] + ifNotEmpty: [ '---', String cr, self metadataAsYAML, String cr, '---', String cr ]. response - nextPutAll: '---'; cr; - nextPutAll: self metadataAsYAML; cr; - nextPutAll: '---'; cr; + nextPutAll: metadataString; nextPutAll: (self body ifNil: [ '' ]). ^ response contents withInternetLineEndings ]