This is because anchor links are a html feature while a link to another tiddler is handled by the javascript engine of tiddlywiki. Linking to a header is not supported by tiddlywiki “vanilla”, and probably wont ever be, however it should be possible to emulate this with a macro or a template.
Here’s an example to get you started :
\define linkto(tiddler,id,text)
<$button class="tc-btn-invisible tc-tiddlylink">
<$text text={{{[[$text$]]~[[$tiddler$]]}}}/>
<$action-navigate $to="$tiddler$" $scroll="no"/>
<$action-sendmessage $message="tm-scroll" selector="#$id$" animationDuration="1000"/>
</$button>
\end
Usage:
<<linkto "Your Tiddler" "your-anchor" "Custom text">>
In the tiddler “Your Tiddler”
<a id="your-anchor"/>
Alternative with a nicer syntax (In a tiddler with the $:/tags/Macro
tag ) :
\define #(link,animationDuration:"1000")
<$let
separator="|"
tiddler={{{ [<__link__>split<separator>nth[1]] }}}
text={{{ [<__link__>split<separator>nth[2]] }}}
selector={{{ #[<__link__>split<separator>nth[3]]+[join[]] }}}
>
<$button class="tc-btn-invisible tc-tiddlylink" tooltip="click once to open, twice to navigate to the section">
<$text text={{{[<text>!is[blank]else<tiddler>]}}}/>
<$action-navigate $to=<<tiddler>> $scroll="no"/>
<$action-sendmessage $message="tm-scroll" selector=<<selector>> animationDuration="$animationDuration$"/>
</$button>
</$let>
\end
\define a(anchor,element:"a") <$element$ id="$anchor$"></$element$>
Usage:
<<# "Your Tiddler|Custom text|your-anchor">>
<<a "your-anchor">>
Clicking the button once will open the tiddler, then clicking again will scroll to the anchor in the tiddler. To open AND scroll to the tiddler in one click I think you will need to use javascript :
https://tiddlywiki.com/#WidgetMessage%3A%20tm-navigate