@@ -810,6 +810,24 @@ def add_node_ids(fragment, counter=0):
810810 return counter + 1
811811
812812
813+ def fixup_ulink (doc , fragment ):
814+ for ulink in find_all_elements (fragment , "ulink" ):
815+ children = ulink .childNodes
816+ assert len (children ) == 2
817+ text = children [0 ]
818+ href = children [1 ]
819+ href .normalize ()
820+ assert len (href .childNodes ) == 1
821+ assert href .childNodes [0 ].nodeType == TEXT
822+ url = href .childNodes [0 ].data
823+ ulink .setAttribute ("href" , url )
824+ ulink .removeChild (href )
825+ content = text .childNodes
826+ while len (content ):
827+ ulink .appendChild (content [0 ])
828+ ulink .removeChild (text )
829+
830+
813831REFMODINDEX_ELEMENTS = ('refmodindex' , 'refbimodindex' ,
814832 'refexmodindex' , 'refstmodindex' )
815833
@@ -976,6 +994,7 @@ def convert(ifp, ofp):
976994 fixup_table_structures (doc , fragment )
977995 fixup_rfc_references (doc , fragment )
978996 fixup_signatures (doc , fragment )
997+ fixup_ulink (doc , fragment )
979998 add_node_ids (fragment )
980999 fixup_refmodindexes (fragment )
9811000 fixup_bifuncindexes (fragment )
0 commit comments