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.
|