diff --git a/src/MiniDocs/Markdown.class.st b/src/MiniDocs/Markdown.class.st index cf759c4..1696097 100644 --- a/src/MiniDocs/Markdown.class.st +++ b/src/MiniDocs/Markdown.class.st @@ -159,7 +159,8 @@ Markdown >> fromFile: aFileReference [ { #category : #'instance creation' } Markdown >> fromString: markdownString [ - (self metadata) at: 'original' put: markdownString yamlMetadata. + markdownString yamlMetadata + ifNotNil: [(self metadata) at: 'original' put: markdownString yamlMetadata]. self body: markdownString contentsWithoutYAMLMetadata ] diff --git a/src/MiniDocs/String.extension.st b/src/MiniDocs/String.extension.st index 7ec24cb..a619ac6 100644 --- a/src/MiniDocs/String.extension.st +++ b/src/MiniDocs/String.extension.st @@ -118,6 +118,7 @@ String >> withoutXMLTagDelimiters [ { #category : #'*MiniDocs' } String >> yamlMetadata [ + self yamlMetadataString ifNil: [^ nil ]. ^ (YAML2JSON fromString: self yamlMetadataString) ]