From b4d6940ec6fde9984e07731e36a92e7b287213d4 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 21 Aug 2024 09:06:39 -0500 Subject: [PATCH] Fixing importing LePicture bug caused by new announcers behavior. --- src/MiniDocs/LeDatabase.extension.st | 8 +++----- src/MiniDocs/OrderedDictionary.extension.st | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/MiniDocs/LeDatabase.extension.st b/src/MiniDocs/LeDatabase.extension.st index e44208a..2131ce8 100644 --- a/src/MiniDocs/LeDatabase.extension.st +++ b/src/MiniDocs/LeDatabase.extension.st @@ -37,7 +37,7 @@ LeDatabase >> addPageCopy: aLePage [ { #category : #'*MiniDocs' } LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocation [ - | remoteMetadata divSnippets dataSnippets snippets page | + | remoteMetadata divSnippets dataSnippets page | divSnippets := (markdeepDocTree xpath: '//div[@st-class]') asOrderedCollection collect: [ :xmlElement | xmlElement postCopy ]. remoteMetadata := Markdeep new metadataFromXML: markdeepDocTree. @@ -52,11 +52,9 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocati dataSnippets := self sanitizeMarkdeepSnippets: divSnippets withMetadata: remoteMetadata. page := LePage new. page fromDictionary: remoteMetadata. - snippets := dataSnippets collect: [ :each | each asLepiterSnippet ]. - snippets do: [ :snippet | "| currentParent |" + dataSnippets do: [:each | | snippet| + snippet := each asLepiterSnippet. page addSnippet: snippet. - "currentParent := page detectParentSnippetWithUid: (snippet metadata at: 'parent'). - snippet parent: currentParent." ]. page children do: [ :snippet | diff --git a/src/MiniDocs/OrderedDictionary.extension.st b/src/MiniDocs/OrderedDictionary.extension.st index 90b763d..e1693b8 100644 --- a/src/MiniDocs/OrderedDictionary.extension.st +++ b/src/MiniDocs/OrderedDictionary.extension.st @@ -10,7 +10,7 @@ OrderedDictionary >> asLepiterSnippet [ | response | self at: 'className' ifAbsent: [ ^ nil ]. response := (self at: 'className') asClass new. - response fromDictionary: self. + [ response fromDictionary: self ] onErrorDo: [ ]. [ response fromString: (self at: 'content') ] onErrorDo: [ ]. self at: 'origin' ifPresent: [ response metadata at: 'origin' put: (self at: 'origin') ]. self at: 'errata' ifPresent: [ response metadata at: 'errata' put: (self at: 'errata') ].