|
From: <mi...@us...> - 2024-06-06 14:03:06
|
Revision: 9741
http://sourceforge.net/p/docutils/code/9741
Author: milde
Date: 2024-06-06 14:03:03 +0000 (Thu, 06 Jun 2024)
Log Message:
-----------
Make `references.AnonymousHyperlinks` transform idempotent.
Don't try to resolve already resolved anonymous hyperlinks again.
Fixes XML round-trip.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/transforms/references.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2024-06-06 14:02:54 UTC (rev 9740)
+++ trunk/docutils/HISTORY.txt 2024-06-06 14:03:03 UTC (rev 9741)
@@ -55,6 +55,10 @@
follows a <meta> or <decoration> element as this is invalid
according to ``docutils.dtd``.
+* docutils/transforms/references.py
+
+ - Make `AnonymousHyperlinks` transform idempotent.
+
* docutils/transforms/universal.py
- `Messages` also handles "loose" system messages generated by the parser.
@@ -72,7 +76,6 @@
when formatting with `indents`_.
-
Release 0.21.2 (2024-04-23)
===========================
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2024-06-06 14:02:54 UTC (rev 9740)
+++ trunk/docutils/docutils/transforms/references.py 2024-06-06 14:03:03 UTC (rev 9741)
@@ -135,11 +135,13 @@
ref.replace_self(prb)
return
for ref, target in zip(anonymous_refs, anonymous_targets):
- target.referenced = 1
+ if ref.hasattr('refid') or ref.hasattr('refuri'):
+ continue
+ target.referenced = True
while True:
if target.hasattr('refuri'):
ref['refuri'] = target['refuri']
- ref.resolved = 1
+ ref.resolved = True
break
else:
if not target['ids']:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|