You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, it's not clear to me that this is a bug or just a difference in expected behavior since I'm trying to use Floki to parse XML rather than HTML.
The issue is that CDATA inside of a <title> tag is not handled.
To Reproduce
Steps to reproduce the behavior:
Using Floki v0.34.1
Using Elixir 1.14.0 (compiled with Erlang/OTP 24)
Using Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
With this code:
# An example to reproduce the problemiex(44)>Floki.parse_document!("<title><![CDATA[handle CDATA]]></title>")[{"title",[],["<![CDATA[handle CDATA]]>"]}]iex(45)>Floki.parse_document!("<tacos><![CDATA[handle CDATA]]></tacos>")[{"tacos",[],["handle CDATA"]}]
Expected behavior
I would expect it to behave like other tags.
# An example to reproduce the problemiex(44)>Floki.parse_document!("<title><![CDATA[handle CDATA]]></title>")[{"title",[],["handle CDATA"]}]
I recognize that this is maybe an artifact of trying to use the library for the wrong purpose (parsing XML) so no problem if you want to close this as "won't fix" or whatever.
Patch
If you do want to fix it, here's a patch that appears to do it.
Description
First, it's not clear to me that this is a bug or just a difference in expected behavior since I'm trying to use Floki to parse XML rather than HTML.
The issue is that CDATA inside of a <title> tag is not handled.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect it to behave like other tags.
I recognize that this is maybe an artifact of trying to use the library for the wrong purpose (parsing XML) so no problem if you want to close this as "won't fix" or whatever.
Patch
If you do want to fix it, here's a patch that appears to do it.
The text was updated successfully, but these errors were encountered: