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

Use hex as id when there is no ascii character (make_id() in nodes.py) [SF:patches:143] #625

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

Comments

@chrisjsewell
Copy link
Owner

author: korean139
created: 2018-08-18 21:56:49.365000
assigned: None
SF_url: https://sourceforge.net/p/docutils/patches/143

attachments:

When there is no ascii character in string, make_id() returns empty string.
This scheme makes nodes with no ascii character remain anonymous, although they need to have id (like headings).

Patch description

In make_id(), after drop every non-ascii characters in id, check whether id is empty string or not.
If id is empty string (case when there id no ascii character in id), let name be hex value of it's own, replace 0x with u (since first character must be [a-z].
(ex. ø (0x00f8) to u00f8, øø (0x00f8 0x00f8) to u00f8u00f8)
Otherwise (case when at least on ascii character exists in id), i didn't modify anything.


commenter: milde
posted: 2018-11-21 21:17:25.787000
title: #143 Use hex as id when there is no ascii character (make_id() in nodes.py)

Thank you for the patch.
In nodes.document.set_id(), there is a provision for the case of an empty return value of
make_id(), so compulsory ids are never empty.
What is your use case (minimal example)? Maybe there is an alternative solution or a workaround.


commenter: milde
posted: 2019-02-12 18:59:18.305000
title: #143 Use hex as id when there is no ascii character (make_id() in nodes.py)

  • status: open --> pending-remind
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