@@ 806-807 (lines=2) @@ | ||
803 | } |
|
804 | function _doHeaders_callback_setext($matches) { |
|
805 | # Terrible hack to check we haven't found an empty list item. |
|
806 | if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) |
|
807 | return $matches[0]; |
|
808 | ||
809 | $level = $matches[2][0] == '=' ? 1 : 2; |
|
810 | $block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>"; |
|
@@ 2509-2510 (lines=2) @@ | ||
2506 | return $text; |
|
2507 | } |
|
2508 | function _doHeaders_callback_setext($matches) { |
|
2509 | if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) |
|
2510 | return $matches[0]; |
|
2511 | $level = $matches[3][0] == '=' ? 1 : 2; |
|
2512 | $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]); |
|
2513 | $block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>"; |
@@ 582-585 (lines=4) @@ | ||
579 | return preg_replace_callback( |
|
580 | '#(<a[^>]* href=(["\']?)(\S+)\2>)\s*(<img[^>]*)(class=(["\']?)[^>]*wp-image-[0-9]+[^>]*\6.*>)\s*</a>#is', |
|
581 | static function( $matches ) { |
|
582 | if ( ! preg_match( '#\.\w+$#', $matches[3] ) ) { |
|
583 | // The a[href] doesn't end in a file extension like .jpeg, so this is not a link to the media file, and should get a lightbox. |
|
584 | return $matches[4] . ' data-amp-lightbox="true" lightbox="true" ' . $matches[5]; // https://github.com/ampproject/amp-wp/blob/1094ea03bd5dc92889405a47a8c41de1a88908de/includes/sanitizers/class-amp-img-sanitizer.php#L419. |
|
585 | } |
|
586 | ||
587 | return $matches[0]; |
|
588 | }, |