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

document.note_explicit_target does not support a node having multiple IDs [SF:patches:167] #649

Open
chrisjsewell opened this issue Aug 9, 2020 · 0 comments

Comments

@chrisjsewell
Copy link
Owner

author: tk0miya
created: 2020-05-04 14:06:48.287000
assigned: None
SF_url: https://sourceforge.net/p/docutils/patches/167

attachments:

We've usually used document.note_explicit_target() and document.note_implicit_target() to register node IDs to document . But they don't support a node having multiple IDs.

from docutils import nodes

document = nodes.document(None, None)
target = nodes.target(ids=['foo', 'bar'])
document.note_explicit_target(target)
assert list(document.ids) == ['foo', 'bar'], document.ids  # => foo was not registered

I think all of IDs for the node should be registered into the document.


commenter: tk0miya
posted: 2020-06-13 16:28:40.720000
title: #167 document.note_explicit_target does not support a node having multiple IDs

Any updates? Please let me know if my thought is incorrect.


commenter: grubert
posted: 2020-06-14 15:24:33.411000
title: #167 document.note_explicit_target does not support a node having multiple IDs

sorry. for the delay.
I will have a look ... and try to get someone more knowledgable to decide


commenter: milde
posted: 2020-07-09 08:48:31.165000
title: #167 document.note_explicit_target does not support a node having multiple IDs

I applied a version in r8522.

Unfortunately, I supoose that only David may tell whether direct specification of more than one ID could lead to problems later.
Docutils only adds an "alias ID" when merging nodes.
Also mind that IDs must conform to the "identifier normalisation"
https://docutils.sourceforge.io/docs/ref/rst/directives.html#identifier-normalization, so it might be preferable to add "names" instead of "ids" and let Docutils do the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant