Include line numbers from the parser.#55
Conversation
a76c00d to
6bac762
Compare
|
Are there any reservations about merging this PR? |
|
The reservation that I have is nokogumbo works correctly (although slower) even when libxml2 headers are not available. This PR introduces a behavioral difference. |
|
Reference for 65535 problem: |
FWIW, I'm OK with this difference, as long as it is documented. |
|
Okay. I'll add this. I just pushed a substantial rewrite to this code that no longer uses recursion to add the elements starting with the leaves. Instead, it starts building the tree in pre-order (which was what your original implementation did, iirc). This was to work around some Nokogiri limitations regarding namespaces (which we now support). But this should be easy enough to redo. I think it's best if we just give up on line numbers greater than 65534 since the correct behavior depends on how libxml2 is built and it doesn't work for every type of node. |
6bac762 to
1b37adf
Compare
Neither libxml2 nor Nokogiri contain an API for setting the line numbers for a node. When the libxml2 headers are available, the line numbers can be set directly in the node structure. Closes: rubys#53
1b37adf to
e884196
Compare
Neither libxml2 nor Nokogiri contain an API for setting the line numbers
for a node. When the libxml2 headers are available, the line numbers can
be set directly in the node structure.