When is this planned for release?
Another C source for imap4-utf-7 decoding https://www.clevercomponents.com/portal/kb/a103/decode-imap-utf7-mailbox-names-in-c.aspx
I like this: It allows to use the same ID for output formats that support it, which are a lot considering HTML5, ODT, XeTeX and XML. It also means that the generated documents of these formats all have the same ID for the same content, including the RST source It stores the ID language restrictions of different target formats within docutils Regarding API, I would make your trim_name() the new make_id(): ``` python #make_id_legacy = make_id def make_id(string, language="legacy"): #... ``` The has_prefix...
This is a nice solution. I would also have a special --identifier-restrictions=none to turn of all ID mappings.
Docutils has versions. A new version is allowed to behave differently, according semantic versioning. Everyone knows that. If someone uses a new version of docutils, it is that one's responsibility to integrate it into its context. Docutils should develop with the associated standards. HTML has standard 5 now. IDs should be modified only according standard 5. This means that only spaces can be replaced when deriving HTML IDs.
I've abbreviated the general concept of identifier with ID. In this general meaning a reference name is an ID, because you reference something by uniquely identifying it. If in docutils there are more reference names and ids then there are more ways to reference an item. That is OK. I was referring only to user chosen reference name_. Let's keep out IDs generated from headers or form :name:. I personally never rely on these generated IDs, because I don't know them. Instead I put .. _`some_title_id`:...
According https://www.w3.org/TR/CSS21/syndata.html#characters an identifier can start with two underscores in CSS. HTML5 allows the id value to start with two underscores (https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute). HTML5 id is specified to not contain spaces, but some browsers do support spaces nevertheless. HTML5 does not specify why it disallows spaces. It should therefore allow spaces. I made a related post about docutils changing IDs in 11/2018: https://sourceforge.net/p/docutils/mailman/message/36453416/...
.. _`__init__`: becomes <p id="init"> instead of <p id="__init__">
#__init__ -> #__init_: last underscore of URL in replacement substitution is dropped