Skip to content

Commit

Permalink
Add missing HTML5 elements (#655)
Browse files Browse the repository at this point in the history
* Place HTML5 element on a new line

This commit reformats the AUTO_BUILD_ELEMENTS list within the HTML
module. Each element now occupies a separate line.

Previously, the list was densely packed, making it harder to read and
maintain. This change:

- Improves readability by providing visual separation between elements.
- Facilitates easier sorting, both manually and potentially with future
  tooling.
- Reduces the scope of diffs when the list is modified. Future changes
  will only affect the relevant lines, not the entire list.

* Add some missing HTML5 elements

Source: https://developer.mozilla.org/en-US/docs/Web/HTML

New, non experimental, non deprecated elements:
- <bdi>
- <data>
- <dialog>
- <picture>
- <rp>
- <rt>
- <ruby>
- <search>
- <slot>
- <template>
- <u>

Close #654
  • Loading branch information
tagliala authored Feb 2, 2025
1 parent 0405ce9 commit 386af3b
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## unreleased [](https://github.com/activeadmin/arbre/compare/v2.1.0...master)

* Add some missing HTML5 elements [#655][] by [@tagliala][]

## 2.1.0 [](https://github.com/activeadmin/arbre/compare/v2.0.2...v2.1.0)

* Add support for ViewComponent. [#644][] by [@budu][]
Expand Down Expand Up @@ -154,6 +158,7 @@ Initial release and extraction from Active Admin
[#617]: https://github.com/activeadmin/arbre/pull/617
[#622]: https://github.com/activeadmin/arbre/pull/622
[#644]: https://github.com/activeadmin/arbre/pull/644
[#655]: https://github.com/activeadmin/arbre/pull/655

[@aramvisser]: https://github.com/aramvisser
[@LTe]: https://github.com/LTe
Expand Down
129 changes: 118 additions & 11 deletions lib/arbre/html/html5_elements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,124 @@
module Arbre
module HTML

AUTO_BUILD_ELEMENTS = [ :a, :abbr, :address, :area, :article, :aside, :audio, :b, :base,
:bdo, :blockquote, :body, :br, :button, :canvas, :caption, :cite,
:code, :col, :colgroup, :command, :datalist, :dd, :del, :details,
:dfn, :div, :dl, :dt, :em, :embed, :fieldset, :figcaption, :figure,
:footer, :form, :h1, :h2, :h3, :h4, :h5, :h6, :head, :header, :hgroup,
:hr, :html, :i, :iframe, :img, :input, :ins, :keygen, :kbd, :label,
:legend, :li, :link, :main, :map, :mark, :menu, :menuitem, :meta, :meter, :nav, :noscript,
:object, :ol, :optgroup, :option, :output, :param, :pre, :progress, :q,
:s, :samp, :script, :section, :select, :small, :source, :span,
:strong, :style, :sub, :summary, :sup, :svg, :table, :tbody, :td,
:textarea, :tfoot, :th, :thead, :time, :title, :tr, :track, :ul, :var, :video, :wbr ]
AUTO_BUILD_ELEMENTS = [
:a,
:abbr,
:address,
:area,
:article,
:aside,
:audio,
:b,
:base,
:bdi,
:bdo,
:blockquote,
:body,
:br,
:button,
:canvas,
:caption,
:cite,
:code,
:col,
:colgroup,
:command,
:data,
:datalist,
:dd,
:del,
:details,
:dfn,
:dialog,
:div,
:dl,
:dt,
:em,
:embed,
:fieldset,
:figcaption,
:figure,
:footer,
:form,
:h1,
:h2,
:h3,
:h4,
:h5,
:h6,
:head,
:header,
:hgroup,
:hr,
:html,
:i,
:iframe,
:img,
:input,
:ins,
:kbd,
:keygen,
:label,
:legend,
:li,
:link,
:main,
:map,
:mark,
:menu,
:menuitem,
:meta,
:meter,
:nav,
:noscript,
:object,
:ol,
:optgroup,
:option,
:output,
:param,
:picture,
:pre,
:progress,
:q,
:rp,
:rt,
:ruby,
:s,
:samp,
:script,
:search,
:section,
:select,
:slot,
:small,
:source,
:span,
:strong,
:style,
:sub,
:summary,
:sup,
:svg,
:table,
:tbody,
:td,
:template,
:textarea,
:tfoot,
:th,
:thead,
:time,
:title,
:tr,
:track,
:u,
:ul,
:var,
:video,
:wbr
]

HTML5_ELEMENTS = [ :p ] + AUTO_BUILD_ELEMENTS

Expand Down

0 comments on commit 386af3b

Please sign in to comment.