Fixing metadata retention between HedgeDoc and Lepiter.
This commit is contained in:
parent
02403b5ae3
commit
58ec9eed76
@ -37,7 +37,9 @@ HedgeDoc >> asLePage [
|
||||
addSnippet: snippet;
|
||||
yourself.
|
||||
newPage incomingLinks.
|
||||
newPage metadata addAll: self metadata.
|
||||
newPage options
|
||||
at: 'originalMetadata' put: self metadata;
|
||||
at: 'url' put: self url.
|
||||
^ newPage
|
||||
]
|
||||
|
||||
@ -162,7 +164,6 @@ HedgeDoc >> url: anObject [
|
||||
(html xpath: '//head/meta[@name="application-name"][@content = "HedgeDoc - Ideas grow better together"]') isEmpty
|
||||
ifTrue: [ self inform: 'Not a hedgedoc url'.
|
||||
url := nil ].
|
||||
self metadata at: 'title' put: tempUrl firstPathSegment.
|
||||
server := tempUrl host.
|
||||
url := anObject
|
||||
]
|
||||
|
@ -160,7 +160,10 @@ Markdown >> fromFile: aFileReference [
|
||||
{ #category : #'instance creation' }
|
||||
Markdown >> fromString: markdownString [
|
||||
markdownString yamlMetadata
|
||||
ifNotNil: [(self metadata) at: 'original' put: markdownString yamlMetadata].
|
||||
ifNotNil: [
|
||||
self metadata
|
||||
ifEmpty: [self metadata: markdownString yamlMetadata]
|
||||
ifNotEmpty: [self metadata at: 'original' put: markdownString yamlMetadata]].
|
||||
self body: markdownString contentsWithoutYAMLMetadata
|
||||
]
|
||||
|
||||
@ -191,6 +194,7 @@ Markdown >> metadata [
|
||||
|
||||
^ metadata ifNil: [ metadata := Dictionary new].
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user