Improving Markdown metadata importation. Exportation needs to be changed consequently.
This commit is contained in:
parent
a4c77629ff
commit
1c935c0de0
@ -55,6 +55,16 @@ Markdown >> contents: anObject [
|
|||||||
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 }
|
{ #category : #utilities }
|
||||||
Markdown >> detectYAMLMetadata [
|
Markdown >> detectYAMLMetadata [
|
||||||
| lines |
|
| lines |
|
||||||
@ -114,7 +124,8 @@ Markdown >> fromFile: aFileReference [
|
|||||||
{ #category : #'instance creation' }
|
{ #category : #'instance creation' }
|
||||||
Markdown >> fromString: markdownString [
|
Markdown >> fromString: markdownString [
|
||||||
self contents: markdownString.
|
self contents: markdownString.
|
||||||
self populateMetadata
|
self populateMetadata.
|
||||||
|
self contents: self contentsWithoutYAMLMetadata
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
Loading…
Reference in New Issue
Block a user