$ show microformats/php-mf2
This repository is a pure, generic microformats2 parser for PHP that makes HTML as easy to consume as a JSON API. It provides both functional and object-oriented interfaces for parsing microformats2 structured data from HTML documents. The parser handles all standard microformats2 property types (p-, u-, dt-, e-), implements implied property parsing, resolves relative URLs according to HTML and URI specifications, and includes backward compatibility for classic microformats markup. It features a robust test suite and follows PSR-0 autoloading standards.
The LLM identified 1 files worth highlighting for reuse:
Contains three self-contained functions (mfNamesFromClass, classHasMf2RootClassname, nestedMfPropertyNamesFromClass) that implement the core logic for detecting and parsing microformat class names (h-, p-, u-, dt-, e- prefixes) according to the microformats2 specification. These functions are completely independent of the Parser class state, making them easily extractable for use in other microformats parsing implementations. They demonstrate non-obvious skill in correctly implementing the microformat class name validation pattern and handling complex cases like multiple prefixes on a single element.