If YAML metadata is absent, then is not shown in the text view.
This commit is contained in:
parent
f85ed1803b
commit
af064db451
@ -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
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user