Closed inoas closed 2 years ago
I am using Floki to render UBB-style xml and there are tags like <pagelink/>
or <media/>
or
Edit:
Application.get_env(:floki, :append_self_closing_tags)
Application.get_env(:floki, :set_self_closing_tags)
Would need to be evaluated.
If this interestes you: Would you also prefer for this to be changable at runtime like the html parser is?
@inoas this is good idea. Maybe :custom_self_closing_tags
?
If this interestes you: Would you also prefer for this to be changable at runtime like the html parser is?
This would be nice as well!
OK, thanks for the go ahead, I will look to find some time to implement.
custom_self_closing_tags
The idea about :append_self_closing_tags
and :set_self_closing_tags
would be to either append to the ones currently set by default / by the developer... or to set them. set_self_closing_tags
could also be put_self_closing_tags
or replace_self_closing_tags
.
This is up to you what you want here, just replacing or appending and replacing? Just let me know :)
I personally don't see much use for replacing them entirely. Seems like only appending is enough.
Feature goal
Would you be interested in a PR that made these configurable. They would stay like this unless someone overwrote some application layer config.
https://github.com/philss/floki/blob/61cd7126c3486c4f857fc7f7a82405dcabf25df0/lib/floki/raw_html.ex#L4-L21
Dependencies
None