-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element wrong location level error handling #132
Comments
Hi! |
I'm trying to understand the problem. But I do not understand. |
Elekt is my colleague. Our use case is the following:
Is there a way how we can find out whether a node was artificially added by myhtml? We currently check if position.length == 0, but this does not work in the example given above. |
There is a "flags" member in myhtml_tree_node_t, but it looks like it is not really in use. It would be nice if this flag can be set to a special value, and that user space programs can inspect it, and check if a node was (for example):
For our own use case it would already be very helpful if we could recognize "artificial" nodes, so that we can skip them when we regenerate the source code. |
I found bug. We need pos.len = 0 (for clone element), but now it contains a garbage. Need to fix it. |
Can you ellaborate a bit more? |
It seems that no, today I will try to deal with this. |
Hello @lexborisov, do you need more info or help in any form? |
@EmielBruijntjes For use: if (node->type & (MyHTML_TREE_NODE_CLONE|MyHTML_TREE_NODE_MOVED)) {
...
} |
@lexborisov Is there anything that I can do to help you here? It's a feature that we really like to have. |
Sorry, but in the current project, I can not do anything about it. Just somehow mark the cloned elements. But I would not want to spend that time. |
I am working on a project that parses html and replaces href attributes.
If the html is invalid because instead a table cell (ex.
<td>
) an<a>
tab is coming, inmyhtml_insertion_mode_in_table
, it tries to handle the parse error by "foster parenting" and callingmyhtml_insertion_mode_in_body
with the<a>
token.The problem is that by this that when I loop through the tree's nodes it seems that the node is added twice. The clone is added in
myhtml_tree_active_formatting_reconstruction
.See the minimal html to reproduce:
testminimal_github.txt
In my application I throw away the copy of the node but for some reason if this happens the href (link 1 in the example) remains the same. Also it messes up the order I get the nodes with
node = myhtml_node_next(node).
I would like to fix this bug in myhtml, and I would appreciate some help.I am not looking to fix the invalid html, but to make sure each href links are changed and the structure stays the same.
The text was updated successfully, but these errors were encountered: