required' : Name -> List Element -> Bool Returns `True` if the element's name can be found in the list of elements.
Totality: total
Visibility: public exportrequired : Name -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the element's list is empty or if no element
have the provided name.
Totality: total
Visibility: public exportrequireds : List Name -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the element's list does not contain at least
one element of the provided list of name.
Totality: total
Visibility: public exportforbiden : Name -> List Element -> Either String (List Element)- Totality: total
Visibility: public export forbidens : List Name -> List Element -> Either String (List Element)- Totality: total
Visibility: public export first : Name -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the first element of the list doesn't match
the provided name.
Totality: total
Visibility: public exportsecond : Name -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the second element of the list doesn't match
the provided name.
Totality: total
Visibility: public exportlength : Nat -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the list's length doesn't match the provided
length.
Totality: total
Visibility: public exportcompareWith : (Nat -> Nat -> Bool) -> Name -> Nat -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the number of occurences of the provided
element name doesn't match the provided count using the provided comparison
operator.
Totality: total
Visibility: public exportcount : Name -> Nat -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the number of occurences of the provided
element name doesn't match the provided count.
Totality: total
Visibility: public exportmax : Name -> Nat -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if the number of occurences of the provided
element is higher than the provided count.
Totality: total
Visibility: public exportis : String -> Element -> Either String Element Ensures that the element is the expected one.
Totality: total
Visibility: public exportelemOf : List String -> String -> Element -> Either String Element Ensures that the `Element`'s name is part of the provided list.
@ listName the name of the list of elements. For example flow content
elements, phrasing content elements, etc.
Totality: total
Visibility: public exportfirstOptional : Name -> List String -> String -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if:
- the first element is not the optional element or an element of the list;
- a further element is not an element of the list.
Totality: total
Visibility: public exportfirstsOptional : Name -> List String -> String -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if:
- the first elements are not the optional element or an element of the list;
- a further element is not an element of the list.
Totality: total
Visibility: public exportfirstOrLastOptional : Name -> List String -> String -> List Element -> Either String (List Element) Returns either the elements' list or an error message.
An error message is returned if:
- the first element is not the optional element or an element of the list;
- a further element is not an element of the list;
- the last element is not the optional element or an element of the list;
- the optional element is the first and last element of the list.
Totality: total
Visibility: public exportflowContentElems : List Element -> Either String (List Element) Ensures that the `Element`s are flow content elements.
Totality: total
Visibility: public exportlistContentElems : Element -> Either String Element Ensures that the `Element` is a list content element.
Totality: total
Visibility: public exportmeta : Element -> Either String Element Ensures that the `Element` is a meta data element.
Totality: total
Visibility: public exportphrasingContentElems : List Element -> Either String (List Element) Ensures that all `Element`s are phrasing content elements.
Totality: total
Visibility: public exportflowOrPhrasingContentElems : List Element -> Either String (List Element) Ensures that all `Element`s are flow or phrasing content elements.
Totality: total
Visibility: public exportliGlobalAttr : List Element -> Either String (List Element) Ensures that **li** elements have only global attributes.
Except for ordered list (**ol**), the **value** attribute has no meaning.
Consequently, only global attributes are allowed for non-ordered lists
(**ul**) and menus (**menu**).
Totality: total
Visibility: public exportmetaCharset : List Element -> Either String (List Element) Ensures that the first element is **meta** with a **charset** attribute.
Totality: total
Visibility: public exportaElems : List Element -> Either String (List Element) Validates an **a** element.
At the exception of **a** elements, accepts:
- flow content
- phrasing content
- interactive content
Totality: total
Visibility: public exportaddressElems : List Element -> Either String (List Element) Validates an **address** element.
Accepts flow content except for the below elements:
- **address**
- **hgroup**
- **h1** to **h6**
- **article**
- **aside**
- **section**
- **nav**
- **header**
- **footer**
Totality: total
Visibility: public exportaudioElems : List Element -> Either String (List Element) Validates an **audio** element.
Accepts all content but **audio** or **video**.
Note: this is a simplification, as there are other constraints based on
the presence of a **src* or *source** attribute and the accepted content
is transparent. For more details, see [MDN documentation][1].
[1]: https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/audio
Totality: total
Visibility: public exportcanvasElems : List Element -> Either String (List Element) Validates a **canvas** element.
Accepts all content but interactive content and the **button** element.
Note: this is a simplification, as this is a transparent element. Also,
interactive content includes other elements depending on the presence of
certain attributes. More details can be found in [MDN documentation][1].
[1]: https://developer.mozilla.org/docs/Web/HTML/Guides/Content_categories#interactive_content
Totality: total
Visibility: public exportcolgroupElems : List Element -> Either String (List Element) Validates a **colgroup** element.
Accepts only **col** elements.
Note: this is a simplification, as **col** elements are not accepted if
a **span** attribute is present in the **colgroup** element. More details
can be found in [MDN documentation][1].
[1]: https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/colgroup
Totality: total
Visibility: public export Validates a **footer** element.
Accepts flow content except for the **header** and **footer** elements.
Totality: total
Visibility: public exportdatalistElems : List Element -> Either String (List Element) Validates a **datalist** element.
Accepts phrasing content or **option** elements.
Totality: total
Visibility: public exportdetailsElems : List Element -> Either String (List Element) Validates a **details** element.
Accepts a **summary** element followed by flow content.
Totality: total
Visibility: public exportdfnElems : List Element -> Either String (List Element) Validates a **dfn** element.
Accepts phrasing content except for the **dfn** element.
Totality: total
Visibility: public exportdivElems : List Element -> Either String (List Element) Validates a **div** element.
Accepts flow content as well as the below additional elements:
- **dt**
- *dd**
- **script**
- **template**.
Note: this is a simplification, as normally those additional elements can
only be present if the parent is a **dl** element. Also, the **script** and
are intermixed with **dd** elements. See [MDN documentation][1] for more
details.
[1]: https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/div
Totality: total
Visibility: public exportdlElems : List Element -> Either String (List Element) Validates a **dl** element.
Accepts **dt**, *dd**, **script** or **template** elements.
This is a supplication. See [MDN documentation][1] for more details.
[1]: https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/dl
Totality: total
Visibility: public exportdtElems : List Element -> Either String (List Element) Validates a **dt** element.
Accepts flow content except for the below:
- **header** element
- **footer** element
- sectioning content
- heading content.
Totality: total
Visibility: public exportfieldsetElems : List Element -> Either String (List Element) Validates a **fieldset** element.
Accepts an optional **legend** followed by flow content.
Totality: total
Visibility: public exportfigureElems : List Element -> Either String (List Element) Validates a **figure** element.
Accepts an optional **figcaption** element which must either be at the
beginning or the end of the children list.
The other children must be flow content elements.
Totality: total
Visibility: public exportformElems : List Element -> Either String (List Element) Validates a **form** element.
Accepts flow content but no **form** element.
Totality: total
Visibility: public exportheadElems : List Element -> Either String (List Element) Validates a **head** element.
Accepts meta elements and one **title** element.
Also, the first element must be **meta** with a **charset** attribute.
Totality: total
Visibility: public export Validates a **header** element.
Accepts flow content except for **header** or **footer** elements.
Totality: total
Visibility: public exporthgroupElems : List Element -> Either String (List Element) Validates a **hgroup** element.
Accepts zero or more **p** elements followed by one **h1** to **h6**
element, followed by zero or more **p** elements.
Totality: total
Visibility: public exporthtmlElems : List Element -> Either String (List Element) Validates the **html** element.
Accepts one **head** element followed by a **body** element.
Totality: total
Visibility: public exportlabelElems : List Element -> Either String (List Element) Validates a **label** element.
Accepts phrasing content except for **label** elements.
Note: it is a simplification, as actually no labelable elements other than
the labeled control are allowed.
See [MDN documentation][1] for more details.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/label
Totality: total
Visibility: public exportlegendElems : List Element -> Either String (List Element) Validates a **legend** element.
Accepts phrasing content as well as **h1** to **h6** elements.
Totality: total
Visibility: public exportmeterElems : List Element -> Either String (List Element) Validates a **meter** element.
Accepts phrasing content except for **meter** elements.
Totality: total
Visibility: public exportnoscriptElems : List Element -> Either String (List Element) Validates a **noscript** element.
Accepts flow content, phrasing content as well as **link**, **style** and
**meta** elements.
Note: it is a simplification, as the allowed content depends on the parent
of the **noscript** element. See [MDN documentation][1] for more details.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/noscript
Totality: total
Visibility: public exportobjectElems : List Element -> Either String (List Element) Validates the **object** element.
Accepts zero or more **param** elements followed by flow or phrasing
content.
Note: it is a simplification, as normally the allowed content is
transparent. See [MDN documentation][1] for more details.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/object
Totality: total
Visibility: public exportoptgroupElems : List Element -> Either String (List Element) Validates the **optgroup** element.
Accepts zero or more **option** elements.
Note: no **legend** element is authorised as customizable select elements is
not considered as "baseline" due to the lack of support by some browsers.
See [MDN documentation][1] for more details.
[1]: https://developer.mozilla.org/docs/Learn_web_development/Extensions/Forms/Customizable_select
Totality: total
Visibility: public exportpictureElems : List Element -> Either String (List Element) Validates the **picture** element.
Accepts zero or more **source** elements followed by one **img** element.
Those elements can be mixed with script-supporting elements.
Totality: total
Visibility: public exportplaintextElems : List Element -> Either String (List Element) Accepts only plain text.
Used for the validation of the **option** and **rp** elements.
Totality: total
Visibility: public exportprogressElems : List Element -> Either String (List Element) Validates a **progress** element.
Accepts phrasing content elements, except **progress** elements.
Totality: total
Visibility: public exportrubyElems : List Element -> Either String (List Element) Validates a **ruby** element.
Accepts phrasing content as well as **rp** and **rt** elements.
Note: it is a simplification, as the allowed content is in reality one or
more groups consisting of two parts. See [MDN documentation][1] for more
details.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ruby
Totality: total
Visibility: public exportulElems : List Element -> Either String (List Element) Validates a **ul** element.
Accepts list content elements. Also, the list elements within **ul** can
only have global attributes.
Totality: total
Visibility: public exportscriptElems : List Element -> Either String (List Element) Validates a **script** element.
Accepts only script content.
Totality: total
Visibility: public exportselectElems : List Element -> Either String (List Element) Validates a **select** element.
Accept only **option**, **optgroup**, **hr**, **button**, **div**,
**script**, **template**, **noscript** or **select** elements.
Also, there can be no more than one **button** element.
Note: this is a simplification, as the **button** must precede the
**option**, **optgroup** and **hr** elements. See [MDN documention][1] for
more details.
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select
Totality: total
Visibility: public exportslotElems : List Element -> Either String (List Element) Validates a **slot** element.
Accepts flow or phrasing content.
Note: this is a simplification as the content is transparent.
Totality: total
Visibility: public exportstyleElems : List Element -> Either String (List Element) Validates a **style** element.
Accepts only CSS content.
Totality: total
Visibility: public exportsummaryElems : List Element -> Either String (List Element) Validates a **summary** element.
Accepts phrasing or heading content.
Totality: total
Visibility: public exporttableElems : List Element -> Either String (List Element) Validates a **table** element.
Accepts:
- first, an optional **caption** element;
- then, zero ore more **colgroup** elements;
- then, an optional **thead** element;
- then, either one or more:
- **tbody** elements; or
- **tr** elements; or
- then, an optional **tfoot** element.
Totality: total
Visibility: public exporttbodyElems : List Element -> Either String (List Element) Validates a **tbody** element.
Accepts only **tr** elements.
Totality: total
Visibility: public exporttemplateElems : List Element -> Either String (List Element) Validates a **template** element.
Accepts all elements except **html**, **head** and **body**.
Totality: total
Visibility: public exportthElems : List Element -> Either String (List Element) Validates a **th** element.
Accepts flow content elements except **header** or **footer** elements or
heading or sectioning content.
Totality: total
Visibility: public exporttrElems : List Element -> Either String (List Element) Validates a **tr** element.
Accepts **th**, **td**, **script** or **template** elements
Totality: total
Visibility: public exportvideoElems : List Element -> Either String (List Element) Validates a **video** element.
If the **video** element has a **src** attribute, accepts:
- zero or more **source** elements; and then
- zero or more **track** elements; and then
- flow, phrasing, embedded or interactive content.
None of the above can contain **video** or **audio** elements.
Note: this is a simplification, as this element can be transparent and
the allowed elements depend on its attributes.
Totality: total
Visibility: public export