Tiddler Link (underline) too "long"

Hello,

in my wiki hover a tiddler in TOC the link has an additional space on the left and right side of tiddlername.

(to show the date (‘erstellt’) in TOC is configured in ‘$:/_macros/alternative/toc’)
$___macros_alternative_toc.json (5.6 KB)

Works at https://tiddlywiki.com/
grafik

Where can that be fixed?

Thanks for support
Stefan

StS,

This seems like the kind of case where you should use the “Inspect” trick on your browser to see how the css is getting parsed, and where that css is coming from. It’s probably some padding-left and padding-right (which affects what the area is that gets underlined).

(It seems what you want is for extra padding (padding-left) to be applied to date, but somehow there’s a stylesheet or theme that is putting the padding only on the link itself, which results in the odd formatting on hover, as the underline crashes into the date to its right.)

-Springer

Hello @Springer,

“Inspect” shows the correct text (Test 8) but “href” not:

What I want is that the underline is as long as the text.
I’m not aware to have a stylsheet that manipulates it.

Greetings
Stefan

When I try it on TiddlyWiki.com, I see the same “problem”. So maybe you need to re-render a tiddler?

The blank space in front comes because the link to the tiddler wraps around a button that controls open/close actions. You can see the same underlined space on a regular TOC, but you might not notice it because of the button.

However, there are two missing icons in your kit. Not having a button makes the gap in front more obvious. Do you mean for those buttons to be missing?

I haven’t figured out where the gap at the end of the link is coming from. I guess it’s some strange CSS that is extending the border of the link. Maybe someone with better CSS skills will be able to explain it.

G’day,

It isn’t a CSS issue.

These are spaces appearing in the links because of the “pretty formatting” of the wikitext in the macro tiddler.

Indenting html/wikitext/widgets/etc. makes it easier to read, but it can sometimes screw-up the intended rendering.

Well, that’s my guess, because I didn’t alter anything other than get rid of pretty indenting which I’m thinking introduced that annoying leading space.

I went “unindent” crazy and might not have noticed a trailing space (at the end of a line).

I’ve “unprettied” a good chunk of the content in there, and the leading space is now gone.

$__core_macros_toc.json (5.1 KB)

And the tiddler I used for testing:
New Tiddler.json (201 Bytes)

Screenshot 2022-07-13 8.13.11 PM - Display 1

Thanks @Charlie_Veniot.

this looks good, but ‘toc-tabbed-internal-nav’ didn’t work anymore.

In your modified version there is this code missing:

\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
<$linkcatcher to=<<__selectedTiddler__>>>
  <$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>>/>
</$linkcatcher>
\end

I copied it at the end, but it didn’t work - see: $__core_macros_toc_modified.json (5.6 KB)

Here are some Test-files:
Test - toc-tabbed-internal-nav.json (444 Bytes)

Test 8.json (1.3 KB)
Test 9.json (837 Bytes)
Test 10.json (774 Bytes)

Thanks for your support
Stefan

It seems there is some additional whitespace used to adjust the element spacing, instead of proper CSS settings. I think it’s a bug. …

But even if we would fix that in the core you would need to adjust your macro too.

You are right. I’ll create a github issue. The fix should be straight forward. We should use the \whitespace trim pragma inside every macro definition. … A bit more testing is needed.

Edit: https://github.com/Jermolene/TiddlyWiki5/issues/6782

Can you explain where it’s introduced? I couldn’t find it offhand.
Thanks!

It’s introduced by the “redability indentation” of the source code without the \whitespace trim option

Well, sometimes I may be wrong. Sometimes I may be right. Sometimes I may just be the lunatic nobody was really looking for …

Ah. Now it’s obvious. Thanks!

Hello @pmario,
thanks for dedecting and opening an issue for this bug.
Stefan

Hello @pmario,

I saw, the issue 6782 has been fixed:

I copied https://tiddlywiki.com/#%24%3A%2Fcore%2Fmacros%2Ftoc into my wiki and I have still same behavior:

What else is missing?

Im running v5.2.3 in TiddlyDesktop (Version 0.0.15-prerelease.2)

Thanks
Stefan

You need to use the prerelease: https://tiddlywiki.com/prerelease/#%24%3A%2Fcore%2Fmacros%2Ftoc

Hello @pmario,

it doesn’t change - same issue:
grafik

Are you sure, you did CTRL reload the browser tab of the prerelease? … I did test it at the prerelease page and there are no extra spaces anymore. … Are you sure you don’t have a second tiddler with the “old” toc anywhere in your wiki?

Hello @pmario

Im running v5.2.3 in TiddlyDesktop (Version 0.0.15-prerelease.2)
I copied content of prerelease (https://tiddlywiki.com/prerelease/#%24%3A%2Fcore%2Fmacros%2Ftoc) into my wiki, saved, closed and reopened it.

What do you mean with

Are you sure you don’t have a second tiddler with the “old” toc anywhere in your wiki?

I have tiddlers with “toc-selective-expandable” and “toc-tabbed-internal-nav” - eg:

Is there additional coding needed?

Thanks
Stefan

That’s how <<toc-selective-expandable>> looks like, if you test it on tiddlywiki.com/prerelease.

image

AS you can see, there is no date. … So it’s very likely, that you have overwritten the default macros and use a custom one. That’s why the changes from the prerelease don’t work.

You can open the AdvancedSearch → Filter tab and search for: \define toc-selective-expandable

It will show you all tiddlers, that define the macro. One of them shouldn’t be there.

Hello @pmario,

thanks for the hint.

I have additonal this macro tiddler: $:/_macros/alternative/toc
This macro was a copy of $:/macros/toc added the code to show my ‘published’ field.
The content was still the old code without the \whitespace trim option in…

I replaced it with code from prerelease and it works.

Thanks for your patient and your appreciated feedback.
Stefan