You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 inid
, check whetherid
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, replace0x
withu
(since first character must be[a-z]
.(ex.
ø
(0x00f8) tou00f8
,øø
(0x00f8 0x00f8) tou00f8u00f8
)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)
The text was updated successfully, but these errors were encountered: