#36124: Importing from django.contrib.admindocs.views modifies docutils rst
parser
-------------------------------------+-------------------------------------
Reporter: Michal Čihař | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admindocs | Version: dev
Severity: Normal | Resolution: needsinfo
Keywords: docutils | Triage Stage:
simplify_regex roles | Unreviewed
register_canonical_role |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Michal Čihař):
Replying to [comment:1 Natalia Bidart]:
> I see your point, but I also see that Django registers a specific role,
with a non common name `cmsreference`. Could you provide more details on
how this would produce undesired side effects (other than having a new
role defined)?
It does register other roles:
https://github.com/django/django/blob/e262d5355d82901f81fba6c7015643c2b87125bf/django/contrib/admindocs/utils.py#L94-L100
Using any of them causes crashes while parsing rst via docutils because
the code relies on setting not present in docutils by default:
https://github.com/django/django/blob/e262d5355d82901f81fba6c7015643c2b87125bf/django/contrib/admindocs/utils.py#L132
For now, we work around this by setting this when invoking docutils:
https://github.com/WeblateOrg/weblate/blob/52ab91edd1ff2797da486ddac359688e7cc40744/weblate/checks/markup.py#L495
> To me, while the potential for undesirable side effects exists, these
appear to be theoretical at this point.
I'm not chasing theoretical issues, I'm trying to address issue that hit
me.
--
Ticket URL: <https://code.djangoproject.com/ticket/36124#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701948f514999-c5d5209e-952a-4b3c-9725-fe0c817e2870-000000%40eu-central-1.amazonses.com.