finished all inline text semantics tags

This commit is contained in:
Joby 2023-09-10 14:51:46 +00:00
parent 7e87f6d618
commit 76a5eae11e
4 changed files with 84 additions and 1 deletions

View file

@ -5,7 +5,9 @@ namespace ByJoby\HTML\Html5\InlineTextSemantics;
use ByJoby\HTML\Tags\AbstractTag;
/**
* The <br> 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 <br> 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

View file

@ -0,0 +1,36 @@
<?php
namespace ByJoby\HTML\Html5\InlineTextSemantics;
use ByJoby\HTML\Tags\AbstractContainerTag;
/**
* The <u> 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 <u> 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 <u> to underline text for presentation purposes, or to
* denote titles of books.
*
* In most cases, you should use an element other than <u>, such as:
*
* * <em> to denote stress emphasis
* * <b> to draw attention to text
* * <mark> to mark key words or phrases
* * <strong> to indicate that text has strong importance
* * <cite> to mark the titles of books or other publications
* * <i> 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';
}

View file

@ -0,0 +1,26 @@
<?php
namespace ByJoby\HTML\Html5\InlineTextSemantics;
use ByJoby\HTML\Tags\AbstractContainerTag;
/**
* The <var> 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 <var> to denote variable names in a
* mathematical equation.
*
* ```
* <p>A simple equation: <var>x</var> = <var>y</var> + 2</p>
* ```
*
* 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';
}

View file

@ -0,0 +1,19 @@
<?php
namespace ByJoby\HTML\Html5\InlineTextSemantics;
use ByJoby\HTML\Tags\AbstractTag;
/**
* The <wbr> 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';
}