Skip to content

Commit

Permalink
AMP不具合の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yhira committed Jun 22, 2020
1 parent 0d679e8 commit d338a25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/amp.php
Expand Up @@ -533,7 +533,7 @@ function convert_content_for_amp($the_content){
switch (get_amp_image_zoom_effect()) {
case 'amp-image-lightbox':
//amp-img を amp-image-lightbox 用に置換
$pattern = '{<a href="[^"]+?/wp-content/uploads.+?"><amp-img(.+?)></a>}i';
$pattern = '{<a href="[^"]+?/wp-content/uploads[^"]+?"><amp-img(.+?)></a>}i';
$append = '<amp-img class="amp-lightbox amp-image-lightbox" on="tap:amp-lightbox" role="button" tabindex="0"$1>';

if (preg_match_all($pattern, $the_content, $m)) {
Expand All @@ -559,7 +559,7 @@ function convert_content_for_amp($the_content){
break;
case 'amp-lightbox-gallery':
// amp-img を amp-lightbox-gallery 用に置換
$pattern = '{<a href="[^"]+?/wp-content/uploads.+?"><amp-img(.+?)></a>}i';
$pattern = '{<a href="[^"]+?/wp-content/uploads[^"]+?"><amp-img(.+?)></a>}i';
if (preg_match_all($pattern, $the_content, $m)) {
$all_idx = 0;
$etc_idx = 1;
Expand Down

0 comments on commit d338a25

Please sign in to comment.