mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-16 22:49:25 +03:00
nixos-render-docs: move escaping functions to new modules
these modules will be extended with more functionality. md will ultimately contain MD-related code such as parsers and converter base classes. docbook will contain renderers.
This commit is contained in:
parent
be6a25368f
commit
986e48ca22
3 changed files with 28 additions and 25 deletions
|
@ -0,0 +1,12 @@
|
|||
_xml_id_translate_table = {
|
||||
ord('*'): ord('_'),
|
||||
ord('<'): ord('_'),
|
||||
ord(' '): ord('_'),
|
||||
ord('>'): ord('_'),
|
||||
ord('['): ord('_'),
|
||||
ord(']'): ord('_'),
|
||||
ord(':'): ord('_'),
|
||||
ord('"'): ord('_'),
|
||||
}
|
||||
def make_xml_id(s: str) -> str:
|
||||
return s.translate(_xml_id_translate_table)
|
Loading…
Add table
Add a link
Reference in a new issue