use "<a></a>Content" instead of "<a>Content</a>" #818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this is a good idea:
All of these classless CSS frameworks style all
<a>
tags the same. https://github.com/dbohdan/classless-cssALL OF THEM treat
<a>
as "a link" even if it has no href. This is usually what you want since you might apply anonclick
that you want to appear as a phantom link. This isn't the case with<a name="...">
in the generated HTML fromwit-bindgen markdown
. I suggest instead following a precedent of empty<a name="...">
tags.This
<a name=""></a>
thing has been done before. Quite a lot actually. https://github.com/search?q=%2F%3Ca%20name%3D%5B%22%27%5D.%2B%5B%22%27%5D%3E%3C%5C%2Fa%3E%2F&type=codeConsider:
Before:
After:
Imagine a whole page full of phantom links and you can see why I want to make this change.
This would still preserve the
page.html#the-thing
of the<a name="the-thing"></a>
while making it compatible with the vast majority of CSS that already exists in the ecosystem of classless whole-page CSS presets.Yes, you can solve this by using
:any-link { ... }
https://developer.mozilla.org/en-US/docs/Web/CSS/:any-link but realistically I'm not going to open 100+ PRs on projects that are one-and-done and don't get any more attention -- CSS presets rarely seem to get updated after they are pretty enough. It's much easier just to tweak the generation here to conform to ecosystem expectations.Alternatives:
wit-bindgen markdown
.