Improving Markdown metadata importation. Exportation needs to be changed consequently.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-03-09 15:51:50 -05:00
parent a4c77629ff
commit 1c935c0de0

View File

@ -55,6 +55,16 @@ Markdown >> contents: anObject [
contents := anObject
]
{ #category : #accessing }
Markdown >> contentsWithoutYAMLMetadata [
| newContents |
self detectYAMLMetadata ifFalse: [ ^ self ].
newContents := '' writeStream.
(self lines copyFrom: self yamlMetadataClosingLineNumber + 2 to: self lines size) do: [ :line |
newContents nextPutAll: line; crlf ].
^ newContents contents.
]
{ #category : #utilities }
Markdown >> detectYAMLMetadata [
| lines |
@ -114,7 +124,8 @@ Markdown >> fromFile: aFileReference [
{ #category : #'instance creation' }
Markdown >> fromString: markdownString [
self contents: markdownString.
self populateMetadata
self populateMetadata.
self contents: self contentsWithoutYAMLMetadata
]
{ #category : #accessing }