From 2a238ae2c25e6bdca106adebcb3f5d73ca4bf73d Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 9 Oct 2022 16:26:33 -0500 Subject: [PATCH] Improvement for errors when importing remote content. --- src/MiniDocs/LeDatabase.extension.st | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/MiniDocs/LeDatabase.extension.st b/src/MiniDocs/LeDatabase.extension.st index 2b84900..3d339f6 100644 --- a/src/MiniDocs/LeDatabase.extension.st +++ b/src/MiniDocs/LeDatabase.extension.st @@ -1,7 +1,7 @@ Extension { #name : #LeDatabase } { #category : #'*MiniDocs' } -LeDatabase >> addPageFromMarkdeep: markdeepDocTree [ +LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocation [ | remoteMetadata divSnippets snippets page | divSnippets := (markdeepDocTree xpath: '//div[@st-class]') @@ -23,7 +23,7 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree [ createEmail: (LeEmail new email:(remoteMetadata at: 'creator')); editEmail: (LeEmail new email:(remoteMetadata at: 'modifier')). snippets do: [ :snippet | page addSnippet: snippet ]. - page children collect: [ :snippet | + page children do: [ :snippet | (self hasBlockUID: (snippet uid)) ifTrue: [ | existingPage | existingPage := self pages detect: [ :pageTemp | pageTemp includesSnippetUid: snippet uid ]. @@ -38,12 +38,13 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree [ { #category : #'*MiniDocs' } LeDatabase >> addPageFromMarkdeepUrl: aString [ - | page | page := self detectLocalPageForRemote: aString. - page ifNotNil: [ :arg | (self importErrorMessage: page). - ^ self ]. - ^ self addPageFromMarkdeep: (self docTreeForLink: aString) + page + ifNotNil: [ :arg | + self importErrorMessage: page. + ^ self ]. + ^ self addPageFromMarkdeep: (self docTreeForLink: aString) withRemote: aString ] { #category : #'*MiniDocs' }