`html.make_links_absolute' Ignores `resolve_base_href' Argument

Hi, I'm wanting to use `html.make_links_absolute' [0] with a specific `base_url', which I believe should be possible. With that in mind, I have set the `resolve_base_href' argument to `False'. However, if `<base href=$URL>' tags are present in the document, it uses $URL rather than the given`base_url'. See linked code [1] for an example. I believe this occurs as follows: - `make_links_absolute' final call is to `rewrite_links' with one argument, the `link_repl' function. [2] - `rewrite_links' has `resolve_base_href=True' as a default, so it calls `resolve_base_href'. [3] - `resolve_base_href' then finds the base `tag in the document, and apply its values to all links found in the document'. [4] I think a solution would be to pass the `resolve_base_href' parameter through when `make_links_absolute' calls `resolve_base_href'. Can anyone confirm or correct my logic? Should I report it as a bug? Thanks, Sam [0] https://github.com/lxml/lxml/blob/572e10843774a5d6300125d89bdc423d53c92971/s... [1] http://pastebin.com/UFKj6VsQ [2] https://github.com/lxml/lxml/blob/572e10843774a5d6300125d89bdc423d53c92971/s... [3] https://github.com/lxml/lxml/blob/572e10843774a5d6300125d89bdc423d53c92971/s... [4] https://github.com/lxml/lxml/blob/572e10843774a5d6300125d89bdc423d53c92971/s...
participants (2)
-
Sam Davis
-
Stefan Behnel