From: Günter M. <mi...@us...> - 2022-07-06 06:34:14
|
- **status**: open-fixed --> closed-fixed - **Comment**: Fixed in Docutils 0.19. Thank you for reporting. --- ** [bugs:#448] `Element.index()` returns incorrect results for `Text` nodes** **Status:** closed-fixed **Created:** Tue May 24, 2022 11:38 PM UTC by Adam Turner **Last Updated:** Fri Jun 10, 2022 11:12 AM UTC **Owner:** nobody This captures the bug behind `branches/index-bug`. I'm not sure the general case of `index` is worth fixing, as `Text` nodes are a special case, but it might have implications for `Node.findall`. ```python >>> from docutils import nodes >>> tree = nodes.Element() >>> blah1 = nodes.Text("blah") >>> blah2 = nodes.Text("blah") >>> tree += [nodes.Text("node1"), blah1, blah2] >>> print(tree.pformat()) <Element> node1 blah blah >>> tree[tree.index(blah2)] is blah2 False >>> tree[tree.index(blah2)] is blah1 True ``` A --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |