-
-
Notifications
You must be signed in to change notification settings - Fork 929
Description
(reported on nokogiri-talk by @justinthec)
I haven't had time to look into this, but wanted to capture it so that it wouldn't get forgotten.
Hello,
Preface/libxml2
I've come across a bug that popped up once before in libxml2 back in 2008 where XML_TEXT_NODEs would always return 0 as their line number.
Link: https://mail.gnome.org/archives/xml/2008-July/msg00017.html
It was however patched that day and should have been fixed.
Commit: https://git.gnome.org/browse/libxml2/commit/?id=45efd0878aa56efa4291eec2ecdcff66d2f52fc3
Those three lines that he added still exist in the most current version of libxml2 now just under a conditional check for a (ctxt->linenumbers) flag.
Current Day libxml2: https://git.gnome.org/browse/libxml2/tree/SAX2.c?id=4472c3a5a5b516aaf59b89be602fbce52756c3e9#n1905
Nokogiri
This bug is currently present in Nokogiri 1.6.8.
I've been looking through the source in an attempt to find a fix and I'd appreciate some guidance:
Possibly relevant files:
nokogiri/ext/nokogiri/xml_node.c
Line 1258 in 8e305e4
static VALUE line(VALUE self)
static VALUE line(VALUE self) Any ideas?
Thanks in advance,
Justin