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