amp-toolbox-php
amp-toolbox-php copied to clipboard
Sanitizer: Initial implementation
The AMP Toolbox should include a sanitizer that is a pure PHP variant of the collection of sanitizers currently found in the AMP for WordPress plugin.
The general idea is that the Sanitizer should take regular HTML5 markup and make smart transformations to turn it into AMPHTML markup.
- [ ] Build sanitizer pipeline, similar to optimizer pipeline (possible code reuse)
- [ ] Port over generic sanitizers from https://github.com/ampproject/amp-wp
- [ ] Build CLI command to sanitize a URL or a piece of markup
- [ ] Optional: Build PSR-15 middleware to turn an HTML5 response into an AMPHTML response.
As a concrete outcome for this effort we should consider at least the code from the AMP plugin which is copied into the Web Stories plugin, so the Web Stories dependency on the AMP plugin can be eliminated.