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

Section permalink html anchors are wrong #48210

Closed
ronny mannequin opened this issue Sep 25, 2008 · 6 comments
Closed

Section permalink html anchors are wrong #48210

ronny mannequin opened this issue Sep 25, 2008 · 6 comments
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@ronny
Copy link
Mannequin

ronny mannequin commented Sep 25, 2008

BPO 3960
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2008-09-25.12:54:59.126>
created_at = <Date 2008-09-25.12:41:47.935>
labels = ['type-bug', 'docs']
title = 'Section permalink html anchors are wrong'
updated_at = <Date 2008-09-28.09:14:40.052>
user = 'https://bugs.python.org/ronny'

bugs.python.org fields:

activity = <Date 2008-09-28.09:14:40.052>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-09-25.12:54:59.126>
closer = 'georg.brandl'
components = ['Documentation tools (Sphinx)']
creation = <Date 2008-09-25.12:41:47.935>
creator = 'ronny'
dependencies = []
files = []
hgrepos = []
issue_num = 3960
keywords = []
message_count = 6.0
messages = ['73783', '73784', '73786', '73831', '73832', '73963']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'ronny']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3960'
versions = ['Python 2.5']

@ronny
Copy link
Mannequin Author

ronny mannequin commented Sep 25, 2008

With sphinx svn version 66617, generated html docs have invalid html
anchors: <a class="headerlink" href="#blah"> instead of <a
class="headerlink" name="blah">.

Affected file: sphinx/htmlwriter.py, lines 71 and 373.

@ronny ronny mannequin assigned birkenfeld Sep 25, 2008
@ronny ronny mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Sep 25, 2008
@ronny
Copy link
Mannequin Author

ronny mannequin commented Sep 25, 2008

Sorry, forgot to mention that this happened to the generated Django html
documentations (django svn r9084), if it makes any difference.

After fixing the two lines (as I mentioned), all named link works again.

@birkenfeld
Copy link
Member

Actually this is all right. The generated HTML looks like this:
<span id="blah"></span><h3>Blah<a class="headerlink" href="#blah"
title="Permalink to this headline">¶</a></h3>

So the id is in the span tag, not the a tag. The link generated for the
¶ is a convenience so that you can right-click and say "copy link
location" if you want to have a URL pointing to that heading.

@ronny
Copy link
Mannequin Author

ronny mannequin commented Sep 26, 2008

I should have mentioned that this breaks in-document links, e.g. clicking
on <a href="#blah">blah</a> will not bring you to <span
id="blah"></span><a href="#blah">...</a>.

My point is that the attribute should be "name" instead of "href".

@ronny
Copy link
Mannequin Author

ronny mannequin commented Sep 26, 2008

Sorry, Georg, I just realized what you meant. You're right. But would it
be possible to add "name" *in addition to* "href" so that clicking on in-
document links (e.g. in Table of Contents) would still work? Thanks.

@birkenfeld
Copy link
Member

I don't see that inter-document links *wouldn't* work, except on antique
browsers that insist on <a name> tags only for defining anchors.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant