View Single Post
Old 01-16-2018, 11:26 AM   #265
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 854
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
It’s me again.
Based on the Regex tester, the line number and offset works perfect for xhtml files.
But ... How do I calculate line number for OPF (eg. in metadata, guide)?

For example, I want to check if the language of the file is set to Polish and guide section.
For missing element I need first line with open tag <metadata> or <guide>.
If an error occurs – the exact location in the file.

I've attached sample plugin + test file.
Attached Files
File Type: zip SmallTest.zip (1.7 KB, 597 views)
File Type: epub samplefile.epub (1.7 KB, 726 views)
BeckyEbook is offline   Reply With Quote