-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validator Generated (validator-generated.php file) needs update #231
Comments
Another thing which does not work because the validator is old like my gandpa: Please update the validator. |
Seems that the fork needs a synchronization with the original AMPHTML repo first to get a new generated validation file: "This branch is 12 commits ahead, 5647 commits behind ampproject:master." |
Any plans on updating validator-generated.php? AMP has got many new tags which isn't possible to use due to outdated validator-generated.php. |
Currently seems to be not easy, see also https://www.drupal.org/project/amp/issues/2962305 |
See another discussion here #181 |
I suggest using the generated PHP file in the AMP WordPress plugin: https://github.com/Automattic/amp-wp/blob/develop/includes/sanitizers/class-amp-allowed-tags-generated.php We'd like to work on extracting this into a Composer package as well to make it easier to incorporate. Here's the Python script that generates the file from the latest amphtml release: https://github.com/Automattic/amp-wp/blob/develop/bin/amphtml-update.sh |
Hi @westonruter I was very curious to see this working, and I did some experiments as a proof This experiment is an attempt to merge the functionalites of I work with AMP for Drupal and I am one of the contributors to the Drupal AMP project.
The AMP Library was developed in 2016 by Lullabot in partnership with Google.
Here is the Full list of contributors Maintainers of the Drupal AMP Module:
Here is the Full list of contributors The problemAs Google AMP team keep pushing new functionalities into the AMP Html Project
AMP Library uses an auto-generated class to validate and strip invalid AMP tags, The problem is that the generated file no longer works with the latest AMP HTML code. So, the fix requires a total re-write of the PHP classes and the Python script The experiment1. WordPressI was curious about the Wordpress plugin The Wordpress plugin is mainly maintained by:
Here is the Full list of contributors I decided to have a look into the code to see how it works and what bits of Since the AMP Library is already a standalone package, I started by moving some So, now we have WordPress plugin using AMP Library! It does the job and also prints some debugging information, see screenshots: This is the HTML markup of the article AMP Converter Test
<p style="text-align: center;">Image
<img class="wp-image-13 size-medium aligncenter" src="https://cdn.shopify.com/s/files/1/2222/0805/products/Stereo-845-PP-e1441807241782_480x480.jpg" alt="" width="300" height="198" />
</p>
<p style="text-align: center;">YouTube Video
<iframe src="https://www.youtube.com/embed/cKgIsOA-G-Q" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</p> This is the code that replaces the class: private function build_post_content() {
$amp = new \Lullabot\AMP\AMP();
$content = apply_filters('the_content', $this->post->post_content);
$options = array(
'scope' => 'body',
'add_stats_html_comment' => false
);
$amp->loadHtml($content, $options);
$this->add_data_by_key('post_amp_content', $amp->convertToAmpHtml());
$this->merge_data_for_key('amp_component_scripts', $amp->getComponentJs());
$this->add_data_by_key('post_amp_debug', $amp->warningsHumanHtml());
return; I wanted to change the scope to apply the AMP markup on the full HTML that is How to test this
2. Lullabot AMP LibraryI moved some code from the WP plugin and from the Lullabot fork of AMPHTML into How to regenerate the validator scriptsThe AMP Library currently has both validators (class-amp-allowed-tags-generated.php and validator-generated.php)
The build script will check out the latest tag of AMPHtml, copy the Python The command line tool
Pull requests:
Challenges and ideas
We can either discuss this here, or use
|
I've filed ampproject/amp-wp#2315 to begin an exploration into extracting the logic from the AMP WordPress plugin into something which can be re-used by PHP-based CMSes. |
validator-generated.php file has not been updated for 2 years and there are several implementation like the issue
#222
which removed second or more implementation of side bar.
The text was updated successfully, but these errors were encountered: