#41 Not all Node instances have the source and line attributes set

5 hours ago

The source and line attributes of Node elements are not set for all types of elements. For example, these attributes never get set on bulleted or enumerated list nodes. Other elements (such as literal block) don't have source set depending on the context.


  • Günter Milde

    Günter Milde - 2015-02-19

    Ticket moved from /p/docutils/bugs/245/

  • Günter Milde

    Günter Milde - 2015-03-23

    Source and line attributes of list items are not set, but coincide with the source and line attributes of the first child.

    When do literal blocks not have the internal source and line arguments?

  • Brecht Machiels

    Brecht Machiels - 5 hours ago

    I have had another look at adding these for all elements. I think I managed to set the source and line for all inline elements with a small addition to Inliner.parse().

    However, due to the way docutils works, this doesn't seem to be possible for body elements; they need to be set in each method that corresponds to a body element. That would introduce a lot of duplication, so it would be better to refactor this, but I'm not sure how to go about this. Thoughts and suggestions welcome!

    I'm not yet sure about directives. They might also allow for a more centralized approach.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks