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.
|
^ 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' }
|
{ #category : #'*MiniDocs' }
|
||||||
LeSnippet >> moveToPageTitled: pageName [
|
LeSnippet >> moveToPageTitled: pageName [
|
||||||
| db origin destination thisSnippet |
|
| db origin destination thisSnippet |
|
||||||
|
@ -25,21 +25,6 @@ LeTextSnippet >> metadata [
|
|||||||
^ self metadataUpdate
|
^ 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' }
|
{ #category : #'*MiniDocs' }
|
||||||
LeTextSnippet >> options [
|
LeTextSnippet >> options [
|
||||||
^ options
|
^ options
|
||||||
|
@ -71,21 +71,16 @@ LeTextualSnippet >> metadata [
|
|||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LeTextualSnippet >> metadataUpdate [
|
LeTextualSnippet >> metadataUpdate [
|
||||||
| surrogate |
|
| createEmailSanitized editEmailSanitized |
|
||||||
self parent
|
createEmailSanitized := self createEmail asString withoutXMLTagDelimiters.
|
||||||
ifNil: [ surrogate := nil]
|
editEmailSanitized := self editEmail asString withoutXMLTagDelimiters.
|
||||||
ifNotNil: [
|
|
||||||
self parent isString
|
|
||||||
ifTrue: [ surrogate := self parent]
|
|
||||||
ifFalse: [ surrogate := self parent uidString ]
|
|
||||||
].
|
|
||||||
^ OrderedDictionary new
|
^ OrderedDictionary new
|
||||||
at: 'id' put: self uidString;
|
at: 'id' put: self uidString;
|
||||||
at: 'parent' put: surrogate;
|
at: 'parent' put: self parent uuid;
|
||||||
at: 'created' put: self createTime asString;
|
at: 'created' put: self createTime asString;
|
||||||
at: 'modified' put: self latestEditTime asString;
|
at: 'modified' put: self latestEditTime asString;
|
||||||
at: 'creator' put: self createEmail asString;
|
at: 'creator' put: createEmailSanitized;
|
||||||
at: 'modifier' put: self editEmail asString;
|
at: 'modifier' put: editEmailSanitized;
|
||||||
yourself
|
yourself
|
||||||
]
|
]
|
||||||
|
|
||||||
|
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
|
^ modified
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
String >> withoutXMLTagDelimiters [
|
||||||
|
^ self copyWithoutAll: #($< $>)
|
||||||
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user