Example #1
0
    protected override void VisitElement(HtmlVoidElement e)
    {
      _html.Write($"<{e.NodeName.ToLower()}");

      if (e.Classes.Count > 0)
      {
        var className = string.Join(" ", e.Classes.Where(c => c != null));
        _html.Write($" class=\"{className}\"");
      }

      foreach (var prop in e.Props.Where(prop => prop.Value != null))
      {
        _html.Write($" {prop.Key}=\"{HtmlUtils.Attribute(prop.Value)}\"");
      }

      _html.Write("/>");
    }
Example #2
0
 protected abstract void VisitElement(HtmlVoidElement e);