Loheide-eu-mitarbeiterplatt.../vendor/masterminds/html5/src/HTML5/Parser
Friederich Loheide 9c0f8de791
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Phase 0: Fundament für Inhaus
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3)
- Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung
- Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü
- Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person
- Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“
- Benutzerverwaltung im Admin, Zugang vorläufig über is_admin
- vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/
- PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung
- VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 20:35:30 +00:00
..
CharacterReference.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
DOMTreeBuilder.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
EventHandler.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
FileInputStream.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
InputStream.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
ParseError.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
README.md Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
Scanner.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
StringInputStream.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
Tokenizer.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
TreeBuildingRules.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00
UTF8Utils.php Phase 0: Fundament für Inhaus 2026-09-25 20:35:30 +00:00

The Parser Model

The parser model here follows the model in section 8.2.1 of the HTML5 specification, though we do not assume a networking layer.

 [ InputStream ]    // Generic support for reading input.
       ||
  [ Scanner ]       // Breaks down the stream into characters.
       ||
 [ Tokenizer ]      // Groups characters into syntactic
       ||
[ Tree Builder ]    // Organizes units into a tree of objects
       ||
 [ DOM Document ]     // The final state of the parsed document.

InputStream

This is an interface with at least two concrete implementations:

  • StringInputStream: Reads an HTML5 string.
  • FileInputStream: Reads an HTML5 file.

Scanner

This is a mechanical piece of the parser.

Tokenizer

This follows section 8.4 of the HTML5 spec. It is (roughly) a recursive descent parser. (Though there are plenty of optimizations that are less than purely functional.

EventHandler and DOMTree

EventHandler is the interface for tree builders. Since not all implementations will necessarily build trees, we've chosen a more generic name.

The event handler emits tokens during tokenization.

The DOMTree is an event handler that builds a DOM tree. The output of the DOMTree builder is a DOMDocument.

DOMDocument

PHP has a DOMDocument class built-in (technically, it's part of libxml.) We use that, thus rendering the output of this process compatible with SimpleXML, QueryPath, and many other XML/HTML processing tools.

For cases where the HTML5 is a fragment of a HTML5 document a DOMDocumentFragment is returned instead. This is another built-in class.