Inconsistent markup of links

160 views
Skip to first unread message

Vladimir Vostok

unread,
Jan 10, 2016, 1:19:46 PM1/10/16
to TiddlyWiki
Hi guys,

If I have a link to another tiddler and attempt to apply formatting to it, the effect is inconsistent.

For example;

I have a link [[my tiddler]] which points to a tiddler that already exists.
  • //[[my tiddler]]// works in that the text is again rendered in italics as if the tiddler doesn't exist.
  • ~~[[my tiddler]]~~ also works in that the link is now struck through.
  • __[[my tiddler]]__ also works in that the link is now underlined

However,

  • ''[[my tiddler]]'' has no effect i.e. not bold


Any thoughts?


thanks

Eric Shulman

unread,
Jan 10, 2016, 1:47:11 PM1/10/16
to TiddlyWiki
On Sunday, January 10, 2016 at 10:19:46 AM UTC-8, Vladimir Vostok wrote:
If I have a link to another tiddler and attempt to apply formatting to it, the effect is inconsistent.
I have a link [[my tiddler]] which points to a tiddler that already exists.
  • //[[my tiddler]]// works in that the text is again rendered in italics as if the tiddler doesn't exist.
  • ~~[[my tiddler]]~~ also works in that the link is now struck through.
  • __[[my tiddler]]__ also works in that the link is now underlined

However,

  • ''[[my tiddler]]'' has no effect i.e. not bold
The font-weight styling of tiddler links is controlled by the the tc-tiddlylink CSS class, as defined in the TWCore shadow, [[$:/themes/tiddlywiki/vanilla/base]].

button.tc-tiddlylink,
a
.tc-tiddlylink {
 text
-decoration: none;
 font
-weight: normal;
 color
: <<colour tiddler-link-foreground>>;
 
-webkit-user-select: inherit; /* Otherwise the draggable attribute makes links impossible to select */
}


.tc-sidebar-lists a.tc-tiddlylink {
 color
: <<colour sidebar-tiddler-link-foreground>>;
}


.tc-sidebar-lists a.tc-tiddlylink:hover {
 color
: <<colour sidebar-tiddler-link-foreground-hover>>;
}


button
.tc-tiddlylink:hover,
a
.tc-tiddlylink:hover {
 text
-decoration: underline;
}


a
.tc-tiddlylink-resolves {
}


a
.tc-tiddlylink-shadow {
 font
-weight: bold;
}


a
.tc-tiddlylink-shadow.tc-tiddlylink-resolves {
 font
-weight: normal;
}


a
.tc-tiddlylink-missing {
 font
-style: italic;
}


a
.tc-tiddlylink-external {
 text
-decoration: underline;
 color
: <<colour external-link-foreground>>;
 background
-color: <<colour external-link-background>>;
}


a
.tc-tiddlylink-external:visited {
 color
: <<colour external-link-foreground-visited>>;
 background
-color: <<colour external-link-background-visited>>;
}


a
.tc-tiddlylink-external:hover {
 color
: <<colour external-link-foreground-hover>>;
 background
-color: <<colour external-link-background-hover>>;
}


As you can see, the TWCore applies "font-weight:normal" to regular tiddlylinks, and then applies extra "font-weight:bold" or "font-style:italics" to tc-tiddlylinks-shadow and tc-tiddlylinks-missing, respectively.  As a result, any font styles set in the content surrounding a tiddlylink are ignored in favor of the more specific styles used by the TWCore classes.

To bypass this, just put the following CSS in a tiddler, and tag it with $:/tags/Stylesheet
a.tc-tiddlylink-resolves {font-weight:inherit;}

Note that this only changes the font weight handling for links to existing tiddlers.  Links to shadow tiddlers will still be shown in bold, while links to missing tiddlers will still appear with italics.

enjoy,
-e

Tobias Beer

unread,
Jan 10, 2016, 1:50:33 PM1/10/16
to tiddl...@googlegroups.com
Hi Vladimir,

Looks like the core would need an update to the basic theme / stylesheet, so as to have any...

strong > button.tc-tiddlylink, strong > a.tc-tiddlylink

...turn out bold. For now you can add this to a custom stylesheet:

strong > button.tc-tiddlylink,
strong > a.tc-tiddlylink {
font-weight:bold;
}

Addendum: As for basic links, Eric's solution is the better one:

a.tc-tiddlylink-resolves {font-weight:inherit;}

Best wishes,

Tobias.

Vladimir Vostok

unread,
Jan 10, 2016, 5:33:11 PM1/10/16
to TiddlyWiki
Thanks for the quick response guys. I will make the necessary changes.

regards
Reply all
Reply to author
Forward
0 new messages