Farol.Adapter.HEEx (Farol v0.2.0)

Copy Markdown View Source

Parses HEEx template source into Farol.Node trees, statically.

Uses Phoenix.LiveView.TagEngine.Parser (the parser behind the HEEx compiler), so what farol sees is exactly what LiveView compiles. This is an internal, undocumented LiveView module: it lives behind this adapter on purpose, so an upstream change touches one file, not the rule catalog.

Dynamic content maps onto static structure like this:

  • attr={@expr} attributes keep the expression source as their value and land in node.dynamic_attrs. Presence-based rules (img-alt) count them; vocabulary checks (valid-role) skip them.
  • {@attrs} spread attributes are dropped: nothing static to check.
  • <%= if/for ... do %> blocks contribute their branch children, so markup inside conditionals is still audited.
  • Components (<.badge>, <MyApp.Card>) become nodes with their source tag spelling; rules that target HTML tags ignore them.