Implementing readability of LePictureSnippets from Markdeep.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-10-31 14:03:39 -05:00
parent 056dad228a
commit eda63bfc3a
3 changed files with 15 additions and 7 deletions

View File

@ -256,7 +256,9 @@ LeDatabase >> sanitizeMarkdeepSnippets: divSnippets withMetadata: remoteMetadata
snippetData := markdeepDiv asSnippetDictionary.
creationTime := snippetData at: 'created'.
modificationTime := snippetData at: 'modified'.
timestampWarning := [:timestamp | 'Modified timestamps: ', timestamp ,' date and time was replaced instead of nil value. See "origin" metadata for more historical traceability information.'].
timestampWarning := [:timestamp |
'Modified timestamps: ', timestamp ,' date and time was replaced instead of nil value. See "origin" metadata for more historical traceability information.'
].
(creationTime = 'nil' and: [ modificationTime ~= 'nil' ])
ifTrue: [
snippetData redefineTimestampsBefore: modificationTime.

View File

@ -18,7 +18,12 @@ OrderedDictionary >> asLepiterSnippet [
ifTrue: [
response := LePharoSnippet new.
response code: (self at: 'content')
].
].
(self at: 'className') = 'LePictureSnippet'
ifTrue: [
response := LePictureSnippet new.
"response code: (self at: 'content')"
].
response
uid: (LeUID new uidString: (self at: 'id'));
parent: (self at: 'parent');

View File

@ -13,11 +13,12 @@ XMLElement >> asSnippetDictionary [
XMLElement >> sanitizedContent [
| className sanitizedText |
className := self attributes at: 'st-class'.
(className = 'LeTextSnippet') ifTrue: [
sanitizedText := self contentString.
sanitizedText := sanitizedText allButFirst.
sanitizedText := sanitizedText allButLast.
].
((className = 'LeTextSnippet') or: [className = 'LePictureSnippet'])
ifTrue: [
sanitizedText := self contentString.
sanitizedText := sanitizedText allButFirst.
sanitizedText := sanitizedText allButLast.
].
(className = 'LePharoSnippet') ifTrue: [ | joinedText |
sanitizedText := self contentString lines.
sanitizedText := sanitizedText copyFrom: 4 to: sanitizedText size -2.