Using other YAML prepackaged parsers.
This commit is contained in:
parent
d822926612
commit
738697bc63
@ -159,12 +159,18 @@ Markdown >> fromFile: aFileReference [
|
|||||||
|
|
||||||
{ #category : #'instance creation' }
|
{ #category : #'instance creation' }
|
||||||
Markdown >> fromString: markdownString [
|
Markdown >> fromString: markdownString [
|
||||||
markdownString yamlMetadata
|
| yamlMetadataRaw bodyTemp |
|
||||||
|
yamlMetadataRaw := (YamlHeaderParser parse: markdownString).
|
||||||
|
bodyTemp := '' writeStream.
|
||||||
|
(yamlMetadataRaw removeKey: 'body') do: [:paragraph |
|
||||||
|
bodyTemp nextPutAll: paragraph; cr; cr
|
||||||
|
].
|
||||||
|
self body: bodyTemp contents withInternetLineEndings.
|
||||||
|
yamlMetadataRaw
|
||||||
ifNotNil: [
|
ifNotNil: [
|
||||||
self metadata
|
self metadata
|
||||||
ifEmpty: [self metadata: markdownString yamlMetadata]
|
ifEmpty: [ self metadata: yamlMetadataRaw ]
|
||||||
ifNotEmpty: [self metadata at: 'original' put: markdownString yamlMetadata]].
|
ifNotEmpty: [ self metadata at: 'hedgeDoc' put: yamlMetadataRaw ]].
|
||||||
self body: markdownString contentsWithoutYAMLMetadata
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
|
@ -62,6 +62,16 @@ OrderedDictionary >> replaceWithUniqueNilsAndBooleansStartingAt: anInteger [
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
OrderedDictionary >> sanitizeMultilineValuesWith: aString [
|
||||||
|
| toSanitize |
|
||||||
|
toSanitize := OrderedCollection new.
|
||||||
|
self keysAndValuesDo: [:k :v |
|
||||||
|
(v isString and: [v lines size > 1]) ifTrue: [ toSanitize add: k ]
|
||||||
|
].
|
||||||
|
^ toSanitize
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
OrderedDictionary >> treeView [
|
OrderedDictionary >> treeView [
|
||||||
| view |
|
| view |
|
||||||
|
Loading…
Reference in New Issue
Block a user