Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make anchor tags non self-closing #1366

Merged
merged 4 commits into from
Apr 26, 2022
Merged

make anchor tags non self-closing #1366

merged 4 commits into from
Apr 26, 2022

Conversation

djbrown
Copy link
Contributor

@djbrown djbrown commented Apr 22, 2022

@fhoeben
Copy link
Collaborator

fhoeben commented Apr 25, 2022

If I read https://developer.mozilla.org/en-US/docs/Glossary/Empty_element correctly an <a> is not allowed to be empty at all so while indeed you now ensure a separate close tag the HTML would still not be valid
To address that we probably requires an update to the !anchor symbol so we can actually have content for the anchors

@djbrown
Copy link
Contributor Author

djbrown commented Apr 25, 2022

@fhoeben I didn't interpret the article like that. It just says we cannot put child nodes (text or elements) inside empty elements (as listed there).
the article is probably not the best reference for thhis issue, since it for the <a> element, since it doesn't concern non-empty elements (which the <a> element is).

I couln't find a better referenece, the <a> docs don't say anything about wheter there has to be a child node (text or elements), but I think it's fine to have no children here.

I used the w3 HTML validator to check, and it seems we don't have to put text in <a> elements:
https://validator.w3.org/nu/#textarea

<!DOCTYPE html>
<html lang="">
<head>
    <title>Test</title>
</head>
<body>
    <a id="normal">Text</a>
    <a id="no-content"></a>
    <a id="self-closing" />
    <b>some text</b>
</body>
</html>

it only complains about the self-closing node, as in https://validator.w3.org/nu/?doc=http%3A%2F%2Ffitnesse.org%2FPlugIns


but to develop the discussion even further: actually I think that an <a> might not be the best HTML element for representing !anchor since it doesnt reference any other element (no href). it's not a link to somewhere, but instead a reference for others to link to. it could or should be an empty <span id="xyz" />.

@fhoeben
Copy link
Collaborator

fhoeben commented Apr 26, 2022

I believe an a without a href attribute is perfectly valid and was originally the only way to create a link target. Now it indeed adds little value over an (empty) span with an id.

It all looks fine to be merged. Would you mind adding a small item for this fix to the ReleaseNotes page (that way I don't have to remember to do that :-) )?

@djbrown
Copy link
Contributor Author

djbrown commented Apr 26, 2022

@fhoeben done ;-)

@fhoeben fhoeben merged commit 6a06258 into unclebob:master Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing close anchor on FitNesse.UserGuide.AdministeringFitNesse.ApplicationArchitecture
2 participants