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

undefined node after resolving CFI #8

Open
mbret opened this issue Apr 26, 2021 · 3 comments
Open

undefined node after resolving CFI #8

mbret opened this issue Apr 26, 2021 · 3 comments

Comments

@mbret
Copy link

mbret commented Apr 26, 2021

For this CFI

epubcfi(/2/4/2[_preface]/10/1:175)

which points at this fragment of the epub

image

You can check the specific html for the page here

https://pastebin.com/NmW8Uz4T

I am getting an undefined node but a correct offset

image

It looks like the function getChildNodeByCFIIndex seems to fail to retrieve the TEXT_NODE for this part
image

at this state
image

index and cfiCount are both 1 and therefore the function return undefined. The lastChild is the TEXT_NODE

@Juul
Copy link
Member

Juul commented Jun 2, 2021

Thank you. I apologize for the delay but will investigate this soon.

@Juul
Copy link
Member

Juul commented Jun 2, 2021

I just tried running .resolveLast on the HTML you provided using the CFI you provided and it works fine for me. Can you give me the exact code you're using?

@mbret
Copy link
Author

mbret commented Jun 3, 2021

I will try again with your latest update and come back to you

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

2 participants