Double Straight Quotation Marks in Tiddler Titles Used as Tags

123 views
Skip to first unread message

Scott Simmons (Secret-HQ)

unread,
Oct 29, 2018, 4:50:49 AM10/29/18
to TiddlyWiki
Hi, all —

I've just realized tiddlers with titles wrapped in double straight quotation marks yield problems when those titles are used as tags.  To my surprise, there's no issue when the quotation marks appear in certain places in the title string, just when they crop up at the END of the string.

Here are some examples:

Is this a known bug with the tag-pill-inner macro?  It's taken me a while to notice it, and a quick search didn't yield any information on it.

TonyM

unread,
Oct 29, 2018, 7:44:40 AM10/29/18
to TiddlyWiki
Scott,

actions=/> looks broken.

Using a delimiter in tittles is not wise, but if you must everywhere you reference them you mayneed to wrap them in tripple double quotes eg
"""My title "containing a quote" """

Regards
Tony

Scott Simmons (Secret-HQ)

unread,
Oct 29, 2018, 8:30:32 PM10/29/18
to TiddlyWiki
Definitely not the safest practice, Tony!

In my (half-hearted) defense, it's a practice I've had for a loonnnng while (so I have a lot of bad-habit inertia), and quotation marks aren't on the official verboten list:

😇

My workaround for the moment has been to search-and-replace quote pairs in titles with “smart quotes,” which don't have the same issue.

Maybe this is an easy enough fix in the next version of the core, though it's hard to believe I'm the first in all this time to stumble across it and report it.

TonyM

unread,
Oct 29, 2018, 8:47:59 PM10/29/18
to tiddl...@googlegroups.com
Scott,

Did I say I was not also guilty of the same thing?, No I have done such things, Don't get me wrong, you can do this, the only thing is you can no longer assume that titles will not contain quotes, so you need to write wikitext that can handle it like with triple quotes. 

The fact is we could be writing wiki text that handles any level of quotes in titles however we naturally seem to code a minimal amount.  eg value=field-name, value="value with space".

Its andexample of the old saying ”To Assume, is to make an Ass out of U and Me"

I have noticed recently cases where I must use double-quotes on system tiddler names eg value="$:/PSaT/Pinned/Journal" or it may not be read correctly, and the truth be known, my learning of TiddlyWiki was lengthened by my not developing healthy standard practices around this. I dont know how many times I did this value="<<macro-name>>" which does not work, rather than
value=<<macro-name>>

where it already is delimited by
<< >>

Arghhh

Regards
Tony

Mark S.

unread,
Oct 29, 2018, 9:07:16 PM10/29/18
to TiddlyWiki
 There is some new wikitext that can fix this problem, if you're anxious.

Edit $:/core/macros/tag and replace """$tag$""" with <<__tag__>> in the first two macros

Like:

\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler=<<__tag__>> field="title" format="text" />
</$element-tag$>
</$vars>
\end

\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
\end

I'm not sure if you need (or should) replace """$tag$""" everywhere that it appears in that tiddler, but changing it in those two locations was enough to fix your example pages.

Well, it fixed their appearance. If you click on them, it still reveals code. To fix that, you need to
go to $:/core/macros/list and make a similar change in list-tagged-draggable to the set widget.

If you try these changes, be sure to make backups. Though, since they're shadow tiddlers, you can always "delete" the tiddler you edited and start over. Assuming it isn't so broke that you can't get in.

I imagine it would be an afternoon's project to track down all the places that could use this transformation.

Have fun,
-- Mark




Good luck!

-- Mark


TonyM

unread,
Oct 29, 2018, 10:00:02 PM10/29/18
to TiddlyWiki
Mark

Very nice, perhaps this could be a core update?

Tony

BurningTreeC

unread,
Oct 30, 2018, 5:27:02 AM10/30/18
to TiddlyWiki
Hey all,

I've made a Pull Request for this problem some time ago: https://github.com/Jermolene/TiddlyWiki5/pull/3437

I Made other Pull Requests fixing the list-tagged-draggable macros and the TagManager for tags like these:



BTC

Scott Simmons (Secret-HQ)

unread,
Dec 10, 2018, 9:27:54 PM12/10/18
to TiddlyWiki
Ask and ye shall receive!  (Or "make a pull request and it shall ship" in this case?)  This behavior has been addressed and corrected for in version 5.1.18.

Thanks, @TonyM, for pointing out the gremlin; @Mark S., for the core workaround/fix; and @BurningTreeC for keeping up with this and GitHubifying the interest in your earlier pull request.
Reply all
Reply to author
Forward
0 new messages