diff --git a/src/MiniDocs/LeDatabase.extension.st b/src/MiniDocs/LeDatabase.extension.st index 4959e01..24d500e 100644 --- a/src/MiniDocs/LeDatabase.extension.st +++ b/src/MiniDocs/LeDatabase.extension.st @@ -123,7 +123,7 @@ LeDatabase >> errorCardFor: error [ | keepButton overwriteButton loadCopyButton errorMessageUI localPage errorKey | - errorKey := error keys first. + errorKey := error keys last. localPage := self pageWithID: errorKey. keepButton := BrButton new aptitude: BrGlamorousButtonWithIconAndLabelAptitude; @@ -186,7 +186,7 @@ LeDatabase >> gtViewErrorDetailsOn: aView [ LeDatabase >> gtViewErrorDetailsOn: aView withKey: erroKey [ ^ aView explicit - title: 'Errors' translated; + title: 'Errors beta' translated; priority: 5; stencil: [ | container | container := BlElement new diff --git a/src/MiniDocs/LePharoSnippet.extension.st b/src/MiniDocs/LePharoSnippet.extension.st index 8398f08..1528710 100644 --- a/src/MiniDocs/LePharoSnippet.extension.st +++ b/src/MiniDocs/LePharoSnippet.extension.st @@ -9,7 +9,7 @@ LePharoSnippet >> contentAsStringCustomized [ ] { #category : #'*MiniDocs' } -LePharoSnippet >> contentFrom: markdeepDiv [ +LePharoSnippet >> fromMarkdeep: markdeepDiv [ ^ markdeepDiv asSnippetDictionary asLepiterSnippet ] diff --git a/src/MiniDocs/LePictureSnippet.extension.st b/src/MiniDocs/LePictureSnippet.extension.st index 9848bc7..3b574b0 100644 --- a/src/MiniDocs/LePictureSnippet.extension.st +++ b/src/MiniDocs/LePictureSnippet.extension.st @@ -25,6 +25,11 @@ LePictureSnippet >> asMarkdeep [ ^ output contents ] +{ #category : #'*MiniDocs' } +LePictureSnippet >> fromMarkdeep: markdeepDiv [ + ^ markdeepDiv asSnippetDictionary asLepiterSnippet +] + { #category : #'*MiniDocs' } LePictureSnippet >> metadata [ ^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ] @@ -37,8 +42,9 @@ LePictureSnippet >> metadataDiv [ output nextPutAll: '
'. - ^ output. + nextPutAll: ' st-data="' , (STON toStringPretty: self metadata) , '">'; + nextPut: Character lf. + ^ output contents withInternetLineEndings. ] diff --git a/src/MiniDocs/LeSnippet.extension.st b/src/MiniDocs/LeSnippet.extension.st index 2914947..a549628 100644 --- a/src/MiniDocs/LeSnippet.extension.st +++ b/src/MiniDocs/LeSnippet.extension.st @@ -7,7 +7,7 @@ LeSnippet class >> fromMetaMarkdeep: div [ metadata := STON fromString:(div xpath: '@st-data') stringValue. snippet := className asClass new. snippet injectMetadataFrom: metadata. - snippet contentFrom: div. + snippet fromMarkdeep: div. ^ snippet. ] @@ -21,3 +21,13 @@ LeSnippet >> moveToPageTitled: pageName [ origin removeSnippet: thisSnippet. destination addSnippet: thisSnippet. ] + +{ #category : #'*MiniDocs' } +LeSnippet >> sanitizeMetadata [ + self metadata keysAndValuesDo: [:k :v | + (v includesAny: #($< $>)) + ifTrue: [ + self metadata at: k put: (v copyWithoutAll: #($< $>)) + ] + ] +] diff --git a/src/MiniDocs/LeTextSnippet.extension.st b/src/MiniDocs/LeTextSnippet.extension.st index 597de8d..5b678d9 100644 --- a/src/MiniDocs/LeTextSnippet.extension.st +++ b/src/MiniDocs/LeTextSnippet.extension.st @@ -14,7 +14,7 @@ LeTextSnippet >> asLePage [ ] { #category : #'*MiniDocs' } -LeTextSnippet >> contentFrom: markdeepDiv [ +LeTextSnippet >> fromMarkdeep: markdeepDiv [ ^ markdeepDiv asSnippetDictionary asLepiterSnippet ]