Fixing metadata sanitization/exportation.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-11-03 10:25:46 -05:00
parent bb75994dd0
commit 0987d4520f
2 changed files with 8 additions and 7 deletions

View File

@ -15,7 +15,7 @@ LeCodeSnippet >> metadataUpdate [
at: 'parent' put: surrogate;
at: 'created' put: self createTime asString;
at: 'modified' put: self latestEditTime asString;
at: 'creator' put: self createEmail asString;
at: 'modifier' put: self editEmail asString;
at: 'creator' put: self createEmail asString withoutXMLTagDelimiters;
at: 'modifier' put: self editEmail asString withoutXMLTagDelimiters;
yourself
]

View File

@ -66,7 +66,7 @@ LeTextualSnippet >> markdownCustomOpener [
{ #category : #'*MiniDocs' }
LeTextualSnippet >> metadata [
^ self optionAt: 'metadata' ifAbsentPut: [ self metadataUpdate ]
^ self metadataUpdate
]
{ #category : #'*MiniDocs' }
@ -76,7 +76,7 @@ LeTextualSnippet >> metadataUpdate [
editEmailSanitized := self editEmail asString withoutXMLTagDelimiters.
^ OrderedDictionary new
at: 'id' put: self uidString;
at: 'parent' put: self parent uuid;
at: 'parent' put: self parent uid;
at: 'created' put: self createTime asString;
at: 'modified' put: self latestEditTime asString;
at: 'creator' put: createEmailSanitized;
@ -91,11 +91,12 @@ LeTextualSnippet >> options [
{ #category : #'*MiniDocs' }
LeTextualSnippet >> sanitizeMetadata [
self options removeKey: 'metadata'.
self options ifNil: [^ self ].
self options removeKey: 'metadata' ifAbsent: [^ self ].
self metadata keysAndValuesDo: [:k :v |
(v includesAny: #($< $>))
(v asString includesAny: #($< $>))
ifTrue: [
self metadata at: k put: (v copyWithoutXMLDelimiters)
self metadata at: k put: (v asString copyWithoutXMLDelimiters)
]
]
]