fread-ink / epub-cfi-resolver

A simple parser, resolver and generator for the EPUB-CFI format
GNU Affero General Public License v3.0
18 stars 3 forks source link

Fixes the issue in which the root html element is added to the cfi #15

Open halmos opened 3 years ago

halmos commented 3 years ago

See issue #14 and #10.

Please note: I was not able to understand if the CFI test at: https://github.com/fread-ink/epub-cfi-resolver/blob/66f054365c8700abcc64fb2bad71a5156cddb23c/tests/generator.js#L64

should expected to be

cfiStr = 'epubcfi(/4/2[!/^[^]^,^;]/2/4[!/foo^^^[^]]/1:10)';

or

cfiStr = 'epubcfi(/4/2[!/^[^]^,^;]/4[!/foo^^^[^]]/1:10)';

Currently, the code is producing the first one.