From 76a5eae11ee4bb21aea9fa1d18f9f5f9b2243797 Mon Sep 17 00:00:00 2001 From: Joby Elliott Date: Sun, 10 Sep 2023 14:51:46 +0000 Subject: [PATCH] finished all inline text semantics tags --- src/Html5/InlineTextSemantics/BrTag.php | 4 ++- src/Html5/InlineTextSemantics/UTag.php | 36 ++++++++++++++++++++++++ src/Html5/InlineTextSemantics/VarTag.php | 26 +++++++++++++++++ src/Html5/InlineTextSemantics/WbrTag.php | 19 +++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 src/Html5/InlineTextSemantics/UTag.php create mode 100644 src/Html5/InlineTextSemantics/VarTag.php create mode 100644 src/Html5/InlineTextSemantics/WbrTag.php diff --git a/src/Html5/InlineTextSemantics/BrTag.php b/src/Html5/InlineTextSemantics/BrTag.php index 8dfd5c2..1fc1aac 100644 --- a/src/Html5/InlineTextSemantics/BrTag.php +++ b/src/Html5/InlineTextSemantics/BrTag.php @@ -5,7 +5,9 @@ namespace ByJoby\HTML\Html5\InlineTextSemantics; use ByJoby\HTML\Tags\AbstractTag; /** - * The
HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant. + * The
HTML element produces a line break in text (carriage-return). It is + * useful for writing a poem or an address, where the division of lines is + * significant. * * Tag description by Mozilla Contributors licensed under CC-BY-SA 2.5 * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br diff --git a/src/Html5/InlineTextSemantics/UTag.php b/src/Html5/InlineTextSemantics/UTag.php new file mode 100644 index 0000000..ebb6d5b --- /dev/null +++ b/src/Html5/InlineTextSemantics/UTag.php @@ -0,0 +1,36 @@ + HTML element represents a span of inline text which should be + * rendered in a way that indicates that it has a non-textual annotation. This + * is rendered by default as a simple solid underline, but may be altered using + * CSS. + * + * Valid use cases for the element include annotating spelling errors, + * applying a proper name mark to denote proper names in Chinese text, and other + * forms of annotation. + * + * You should not use to underline text for presentation purposes, or to + * denote titles of books. + * + * In most cases, you should use an element other than , such as: + * + * * to denote stress emphasis + * * to draw attention to text + * * to mark key words or phrases + * * to indicate that text has strong importance + * * to mark the titles of books or other publications + * * to denote technical terms, transliterations, thoughts, or names of + * vessels in Western texts + * + * Tag description by Mozilla Contributors licensed under CC-BY-SA 2.5 + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u + */ +class UTag extends AbstractContainerTag +{ + const TAG = 'u'; +} \ No newline at end of file diff --git a/src/Html5/InlineTextSemantics/VarTag.php b/src/Html5/InlineTextSemantics/VarTag.php new file mode 100644 index 0000000..e9940e8 --- /dev/null +++ b/src/Html5/InlineTextSemantics/VarTag.php @@ -0,0 +1,26 @@ + HTML element represents the name of a variable in a mathematical + * expression or a programming context. It's typically presented using an + * italicized version of the current typeface, although that behavior is + * browser-dependent. + * + * Here's a simple example, using to denote variable names in a + * mathematical equation. + * + * ``` + *

A simple equation: x = y + 2

+ * ``` + * + * Tag description by Mozilla Contributors licensed under CC-BY-SA 2.5 + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u + */ +class VarTag extends AbstractContainerTag +{ + const TAG = 'var'; +} \ No newline at end of file diff --git a/src/Html5/InlineTextSemantics/WbrTag.php b/src/Html5/InlineTextSemantics/WbrTag.php new file mode 100644 index 0000000..93a3293 --- /dev/null +++ b/src/Html5/InlineTextSemantics/WbrTag.php @@ -0,0 +1,19 @@ + HTML element represents a word break opportunity—a position within + * text where the browser may optionally break a line, though its line-breaking + * rules would not otherwise create a break at that location. + * + * Tag description by Mozilla Contributors licensed under CC-BY-SA 2.5 + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr + */ +class WbrTag extends AbstractTag +{ + // TODO figure out a way to make tags like this prefer having no whitespace added around them + const TAG = 'wbr'; +} \ No newline at end of file