diff --git a/repository/TiddlyWiki/Tiddler.class.st b/repository/TiddlyWiki/Tiddler.class.st index 4d3a01b..5b1bd0e 100644 --- a/repository/TiddlyWiki/Tiddler.class.st +++ b/repository/TiddlyWiki/Tiddler.class.st @@ -594,18 +594,25 @@ Tiddler >> tagsAsString [ ^ response contents ] +{ #category : #accessing } +Tiddler >> tagsInBrackets [ + | tagsInBrackets | + tagsInBrackets := self rawLinksIn: self tags. + ^ tagsInBrackets +] + { #category : #accessing } Tiddler >> tagsReformating [ - | response sanitized tagsInBrackets | + | response sanitized | self tags class ~= ByteString ifTrue: [ ^ self ]. response := Set new. - tagsInBrackets := self rawLinksIn: self tags. - tagsInBrackets ifNotEmpty: [ - tagsInBrackets do: [:tag | sanitized := self tags copyReplaceAll: tag with: ''. ] + sanitized := self tags. + self tagsInBrackets ifNotEmpty: [ + self tagsInBrackets do: [:tag | sanitized := sanitized copyReplaceAll: tag with: ''. ]. + sanitized := sanitized copyReplaceAll: '[[]] ' with: ''. ]. - sanitized := sanitized copyReplaceAll: '[[]] ' with: ''. response addAll: (sanitized trimmed splitOn: Character space) asSet. - self tags: (response union: tagsInBrackets). + self tags: (response union: self tagsInBrackets). ]