Refactoring binary data cleaning.

This commit is contained in:
Diego Ruidajo 2021-11-30 14:39:25 -05:00
parent 438bff833c
commit a541301d0e

View File

@ -226,11 +226,21 @@ TiddlyWiki >> tiddlersJSONUrl [
] ]
{ #category : #accessing } { #category : #accessing }
TiddlyWiki >> withoutImages [ TiddlyWiki >> withoutApplicationType: application [
| filteredTiddlers tempWiki | | filteredTiddlers tempWiki |
filteredTiddlers := self tiddlers reject: [:tiddler | tiddler type isNotNil and: [tiddler type beginsWith: 'image/'] ]. filteredTiddlers := self tiddlers reject: [:tiddler | tiddler type isNotNil and: [tiddler type beginsWith: application] ].
tempWiki := self copy tempWiki := self copy
tiddlers: filteredTiddlers. tiddlers: filteredTiddlers.
tempWiki tiddlers do: [:tiddler | tiddler wiki: tempWiki ]. tempWiki tiddlers do: [:tiddler | tiddler wiki: tempWiki ].
^ tempWiki ^ tempWiki
] ]
{ #category : #accessing }
TiddlyWiki >> withoutImages [
^ self withoutApplicationType: 'image/'
]
{ #category : #accessing }
TiddlyWiki >> withoutPDFs [
^ self withoutApplicationType: 'application/pdf'
]