Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes included in other nodes but not in children list do not adjust start/end offset for recursive parsing offset #213

Open
vsch opened this issue Jan 3, 2016 · 0 comments

Comments

@vsch
Copy link
Contributor

vsch commented Jan 3, 2016

Nodes get recursively parsed when they are part of list items, block quotes, etc. The start/end offset is adjusted after the parse is complete so the nodes reflect actual offset in the text.

However, the adjustment is done for nodes and their children but some nodes include other nodes that are not part of the child list. These do not get adjusted and this causes their offsets to be outside their parent range.

This affects:

  • FootnoteNode.footnote
  • TableNode.columns
  • RefLink.referenceKey
  • RefImage.referenceKey

I am changing the parser to let AbstractNode.shiftIndices() and AbstractNode.mapIndices() handle the adjustments for children. That way all nodes that have children not in the child list can override the methods and adjust their 'undeclared' child nodes.

vsch added a commit to vsch/pegdown that referenced this issue Jan 3, 2016
@vsch vsch changed the title Nodes included in other nodes but not in children list do not their start/end offset adjusted for recursive parsing offset Nodes included in other nodes but not in children list do not adjust start/end offset for recursive parsing offset Jan 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant