Skip to content

Commit d016e67

Browse files
committed
Improved handling of img elements
1 parent f59c8b9 commit d016e67

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ return [
155155

156156
## Release Notes
157157

158+
### 2.0.6
159+
+ Improved handling of pages containing `<img>` elements
160+
158161
### 2.0.5
159162
+ Added option to specify inclusion of the datestamp
160163

snippets/content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Remove line breaks following <br> tags
77
$buffer = str_replace(array("<br>" . PHP_EOL . PHP_EOL, "<br />" . PHP_EOL . PHP_EOL), PHP_EOL, $buffer);
88
// Remove line breaks preceeding <img> tags
9-
$buffer = preg_replace('/\n\n<p><img .+><\/p>/', '', $buffer);
9+
$buffer = preg_replace('/\n\n(<p>)?<img .+>(<\/p>)?/', '', $buffer);
1010
// Remove all remaining tags
1111
$buffer = html_entity_decode(strip_tags($buffer));
1212
echo $buffer . PHP_EOL . PHP_EOL;

0 commit comments

Comments
 (0)