#22 Bring branches/nesting up to date


I am trying to analyze the code contributed by David Abrahams back in 2004 to see if I can clean it up, bring it up to date, streamline it and thus resubmit it for inclusion in the next update. I tried svn merge 2755:HEAD of the main line into the branch (2755 is the last time Mr. Abrahams merged the mainline in with his branch) with below average results; I tried merging his branch 1813:HEAD (1813 is the re-factored cvs2svn version number of when his branch was spawned) with mixed results. There're been a number of changes the main line since he wrote this in 2004 to even the the main file he changed: docutils/parser/rst/states.py and they are complex so I'm trying to have a go at it but have only just started. I spent most of yesterday struggling with merge so I've only just started looking at the code now; I will update this artifact as I make significant progress and will post my request for help, if needed, here. Of course, help is always welcome. Thanks.

FYI, the nesting branch is a solution which would allow authors to nest inline markup, i.e. *emphasize |H2O| in a **proper** :custom:`diet`*.


  • Jeffrey C. Jacobs

    This patch brings the trunk up to date in terms of implemented the nesting patch; my notes for this were lost though because the web page refreshed but it works for all but raw and raw-derived roles which should not be sub-interpreted, and fails on a weird error for test est_parsers/test_rst/test_inline_markup.py: totest['embedded_URIs'][6]; test_parser and also David Goodger's clever recursive test, which still needs to be fixed, though I can't figure out the nodes.Text.shortrepr error from the other test case. Any help greatly appreciated.

  • Jeffrey C. Jacobs

    Bam! Down to only the infinite recursion issue; the other one was a bug in docutils that I've posted and patched in bug issue 2975987. With that mystery out of the way, I can work on the recursion issue. In principle, I propose that there be a docutils variable, defaulting to 100, that defines the maximum nesting depth the parser will accept. This seems a simple and common sense solution to the recursion depth issue though how easy it'll be to modify David A.'s code to do this is anyone's guess. I hope, though, that if I can get this final test case to pass we can begin SERIOUS discussion on adding nested inline markup to the next major version of docutils since I think we've hashed out the rule for it already, except for recursion, and I believe David A. has coded everything to spec. I will be happy to clean up this code too and we can consider making inline markup an option, but IIRC David G. said if ever we get it working to the community's satisfaction, it would be a no-turning-back kind of change. So, the pressure is on and I hope I can deliver on finally bringing nested inline markup to fruition!


Log in to post a comment.