git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d3db716
)
nieuws: support image containers after article intro
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 17 Feb 2019 16:48:38 +0000
(17:48 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 2 Mar 2019 15:00:32 +0000
(16:00 +0100)
Split body even if images are wrapped in a figure or paragraph element.
nieuws.inc.php
patch
|
blob
|
history
diff --git
a/nieuws.inc.php
b/nieuws.inc.php
index 0e3c877890020c13ab8c7a300c100a05d1fa6471..a0fa821b93647356efe421eb9db95198ee997197 100644
(file)
--- a/
nieuws.inc.php
+++ b/
nieuws.inc.php
@@
-78,7
+78,7
@@
class ArchiveArticle
{
$this->title;
$rest = fread($this->file, filesize($this->page));
- if ( preg_match('{\n
<p>(<img [^>]*>)</p>|\n<hr />}
', $rest, $img, PREG_OFFSET_CAPTURE) ) {
+ if ( preg_match('{\n
< (?: p | figure [^>]* ) > (<img\ [^>]*>) | \n <hr\ />}x
', $rest, $img, PREG_OFFSET_CAPTURE) ) {
if (isset($img[1])) {
$this->img = $img[1][0];
}