Replace anchor tag with main tag in the HTML export template

Every tiddler exported in HTML format has its content enclosed in <a> anchor tag, like so

<a name="New Tiddler>
<div ....
</a>

I tracked the code to this tiddler, $:/core/templates/static-tiddler.

<a name=<<currentTiddler>>>
<$transclude tiddler="$:/core/ui/ViewTemplate"/>
</a>

What purpose does the anchor tag serve here?

The MDN web docs say that the name attribute is deprecated.

Was required to define a possible target location in a page. In HTML 4.01, id and name could both be used on <a> , as long as they had identical values.

If I understand correctly, then we can replace a with a main tag and id attribute.

<main id="New-Tiddler>
<div ....
</main>
2 Likes

I agree with you, it’s weird to use anchor tag like that.

Instead of main, perhaps the article tag would be more suited since several tiddlers could be exported in one html static file ?

1 Like