Improving metadata sanitization.
This commit is contained in:
parent
f52e027edd
commit
1e97ae3489
21
src/MiniDocs/LeCodeSnippet.extension.st
Normal file
21
src/MiniDocs/LeCodeSnippet.extension.st
Normal file
@ -0,0 +1,21 @@
|
||||
Extension { #name : #LeCodeSnippet }
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeCodeSnippet >> metadataUpdate [
|
||||
| surrogate |
|
||||
self parent
|
||||
ifNil: [ surrogate := nil]
|
||||
ifNotNil: [
|
||||
self parent isString
|
||||
ifTrue: [ surrogate := self parent]
|
||||
ifFalse: [ surrogate := self parent uidString ]
|
||||
].
|
||||
^ OrderedDictionary new
|
||||
at: 'id' put: self uidString;
|
||||
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;
|
||||
yourself
|
||||
]
|
@ -11,6 +11,26 @@ LeSnippet class >> fromMetaMarkdeep: div [
|
||||
^ snippet.
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeSnippet >> metadata [
|
||||
^ self metadataUpdate
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeSnippet >> metadataUpdate [
|
||||
| createEmailSanitized editEmailSanitized |
|
||||
createEmailSanitized := self createEmail asString withoutXMLTagDelimiters.
|
||||
editEmailSanitized := self editEmail asString withoutXMLTagDelimiters.
|
||||
^ OrderedDictionary new
|
||||
at: 'id' put: self uidString;
|
||||
at: 'parent' put: self parent uuid;
|
||||
at: 'created' put: self createTime asString;
|
||||
at: 'modified' put: self latestEditTime asString;
|
||||
at: 'creator' put: createEmailSanitized;
|
||||
at: 'modifier' put: editEmailSanitized;
|
||||
yourself
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeSnippet >> moveToPageTitled: pageName [
|
||||
| db origin destination thisSnippet |
|
||||
|
@ -25,21 +25,6 @@ LeTextSnippet >> metadata [
|
||||
^ self metadataUpdate
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeTextSnippet >> metadataUpdate [
|
||||
| createEmailSanitized editEmailSanitized |
|
||||
createEmailSanitized := self createEmail asString withoutXMLTagDelimiters.
|
||||
editEmailSanitized := self editEmail asString withoutXMLTagDelimiters.
|
||||
^ OrderedDictionary new
|
||||
at: 'id' put: self uidString;
|
||||
at: 'parent' put: self parentId;
|
||||
at: 'created' put: self createTime asString;
|
||||
at: 'modified' put: self latestEditTime asString;
|
||||
at: 'creator' put: createEmailSanitized;
|
||||
at: 'modifier' put: editEmailSanitized;
|
||||
yourself
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeTextSnippet >> options [
|
||||
^ options
|
||||
|
@ -71,22 +71,17 @@ LeTextualSnippet >> metadata [
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeTextualSnippet >> metadataUpdate [
|
||||
| surrogate |
|
||||
self parent
|
||||
ifNil: [ surrogate := nil]
|
||||
ifNotNil: [
|
||||
self parent isString
|
||||
ifTrue: [ surrogate := self parent]
|
||||
ifFalse: [ surrogate := self parent uidString ]
|
||||
].
|
||||
| createEmailSanitized editEmailSanitized |
|
||||
createEmailSanitized := self createEmail asString withoutXMLTagDelimiters.
|
||||
editEmailSanitized := self editEmail asString withoutXMLTagDelimiters.
|
||||
^ OrderedDictionary new
|
||||
at: 'id' put: self uidString;
|
||||
at: 'parent' put: surrogate;
|
||||
at: 'parent' put: self parent uuid;
|
||||
at: 'created' put: self createTime asString;
|
||||
at: 'modified' put: self latestEditTime asString;
|
||||
at: 'creator' put: self createEmail asString;
|
||||
at: 'modifier' put: self editEmail asString;
|
||||
yourself
|
||||
at: 'creator' put: createEmailSanitized;
|
||||
at: 'modifier' put: editEmailSanitized;
|
||||
yourself
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
21
src/MiniDocs/LeUnknownSnippet.extension.st
Normal file
21
src/MiniDocs/LeUnknownSnippet.extension.st
Normal file
@ -0,0 +1,21 @@
|
||||
Extension { #name : #LeUnknownSnippet }
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeUnknownSnippet >> metadataUpdate [
|
||||
| surrogate |
|
||||
self parent
|
||||
ifNil: [ surrogate := nil]
|
||||
ifNotNil: [
|
||||
self parent isString
|
||||
ifTrue: [ surrogate := self parent]
|
||||
ifFalse: [ surrogate := self parent uidString ]
|
||||
].
|
||||
^ OrderedDictionary new
|
||||
at: 'id' put: self uidString;
|
||||
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;
|
||||
yourself
|
||||
]
|
@ -32,3 +32,8 @@ String >> romanizeAccents [
|
||||
].
|
||||
^ modified
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
String >> withoutXMLTagDelimiters [
|
||||
^ self copyWithoutAll: #($< $>)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user