View Single Post
Old 01-21-2018, 04:35 PM   #284
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
The opf obtained by bk.get_opf() is built on the fly to reflect whatever changes have been done in and by the plugin so far. The same is true inside Sigil as well. The opf is always kept in machine parseable format. Things like comments and whitespace are not kept as they will be rebuilt as files are added and removed. You should only use line offsets to report errors in the opf as whitespace is meaningless.

A validator should not be modifying anything and in that case doing as DiapDealer said in his post above will give you the original opf that was present when the plugin was started. As soon as a plugin modifies something that impacts the opf, even this function will return the built on the fly version of the opf.

Last edited by KevinH; 01-21-2018 at 04:45 PM.
KevinH is online now   Reply With Quote