diff --git a/src/MiniDocs/HedgeDoc.class.st b/src/MiniDocs/HedgeDoc.class.st index 4efbb71..2f03c29 100644 --- a/src/MiniDocs/HedgeDoc.class.st +++ b/src/MiniDocs/HedgeDoc.class.st @@ -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 ] diff --git a/src/MiniDocs/Markdown.class.st b/src/MiniDocs/Markdown.class.st index c99a7f2..c155ec9 100644 --- a/src/MiniDocs/Markdown.class.st +++ b/src/MiniDocs/Markdown.class.st @@ -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 ] @@ -190,6 +193,7 @@ Markdown >> lines [ Markdown >> metadata [ ^ metadata ifNil: [ metadata := Dictionary new]. + ]