From a541301d0e59c74ada5d525ff6d988d99e3505e5 Mon Sep 17 00:00:00 2001 From: Diego Ruidajo Date: Tue, 30 Nov 2021 14:39:25 -0500 Subject: [PATCH] Refactoring binary data cleaning. --- repository/TiddlyWiki/TiddlyWiki.class.st | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index 79170e4..5e2030b 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -226,11 +226,21 @@ TiddlyWiki >> tiddlersJSONUrl [ ] { #category : #accessing } -TiddlyWiki >> withoutImages [ +TiddlyWiki >> withoutApplicationType: application [ | 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 tiddlers: filteredTiddlers. tempWiki tiddlers do: [:tiddler | tiddler wiki: tempWiki ]. ^ tempWiki ] + +{ #category : #accessing } +TiddlyWiki >> withoutImages [ + ^ self withoutApplicationType: 'image/' +] + +{ #category : #accessing } +TiddlyWiki >> withoutPDFs [ + ^ self withoutApplicationType: 'application/pdf' +]