Fixing importing LePicture bug caused by new announcers behavior.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-08-21 09:06:39 -05:00
parent 7bbf399ae1
commit b4d6940ec6
2 changed files with 4 additions and 6 deletions

View File

@ -37,7 +37,7 @@ LeDatabase >> addPageCopy: aLePage [
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocation [ LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocation [
| remoteMetadata divSnippets dataSnippets snippets page | | remoteMetadata divSnippets dataSnippets page |
divSnippets := (markdeepDocTree xpath: '//div[@st-class]') asOrderedCollection divSnippets := (markdeepDocTree xpath: '//div[@st-class]') asOrderedCollection
collect: [ :xmlElement | xmlElement postCopy ]. collect: [ :xmlElement | xmlElement postCopy ].
remoteMetadata := Markdeep new metadataFromXML: markdeepDocTree. remoteMetadata := Markdeep new metadataFromXML: markdeepDocTree.
@ -52,11 +52,9 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocati
dataSnippets := self sanitizeMarkdeepSnippets: divSnippets withMetadata: remoteMetadata. dataSnippets := self sanitizeMarkdeepSnippets: divSnippets withMetadata: remoteMetadata.
page := LePage new. page := LePage new.
page fromDictionary: remoteMetadata. page fromDictionary: remoteMetadata.
snippets := dataSnippets collect: [ :each | each asLepiterSnippet ]. dataSnippets do: [:each | | snippet|
snippets do: [ :snippet | "| currentParent |" snippet := each asLepiterSnippet.
page addSnippet: snippet. page addSnippet: snippet.
"currentParent := page detectParentSnippetWithUid: (snippet metadata at: 'parent').
snippet parent: currentParent."
]. ].
page children page children
do: [ :snippet | do: [ :snippet |

View File

@ -10,7 +10,7 @@ OrderedDictionary >> asLepiterSnippet [
| response | | response |
self at: 'className' ifAbsent: [ ^ nil ]. self at: 'className' ifAbsent: [ ^ nil ].
response := (self at: 'className') asClass new. response := (self at: 'className') asClass new.
response fromDictionary: self. [ response fromDictionary: self ] onErrorDo: [ ].
[ response fromString: (self at: 'content') ] onErrorDo: [ ]. [ response fromString: (self at: 'content') ] onErrorDo: [ ].
self at: 'origin' ifPresent: [ response metadata at: 'origin' put: (self at: 'origin') ]. self at: 'origin' ifPresent: [ response metadata at: 'origin' put: (self at: 'origin') ].
self at: 'errata' ifPresent: [ response metadata at: 'errata' put: (self at: 'errata') ]. self at: 'errata' ifPresent: [ response metadata at: 'errata' put: (self at: 'errata') ].