CrowdHailer / eex_html

Extension to Embedded Elixir (EEx), that allows content to be safely embedded into HTML.
https://hex.pm/packages/eex_html
Apache License 2.0
3 stars 5 forks source link

Fix warnings that come from the `EEx.HTML.Safe` protocol warnings. #1

Closed CrowdHailer closed 5 years ago

CrowdHailer commented 6 years ago
:0: Unknown function 'Elixir.EEx.HTML.Safe.Atom':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.BitString':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Float':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Function':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Integer':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.List':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Map':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.PID':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Port':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Reference':'__impl__'/1
:0: Unknown function 'Elixir.EEx.HTML.Safe.Tuple':'__impl__'/1

I think these warnings can be fixed by adding an implementation for each of the types. It would be overkill because everysingle implementation would just call the implementation of String.Chars.to_string and escape the result.

Because I have an implementation for Any I think they would all be redundant an exist only to clean up these warnings.

Is there a better way to fix this?

Issue copied from https://github.com/CrowdHailer/raxx/issues/133