From a0aabc55f0c4caf66b25745f1c5eaa169acda64c Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 12 Aug 2024 15:03:23 -0500 Subject: [PATCH] Debugging tags reformating. --- repository/TiddlyWiki/Tiddler.class.st | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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). ]