Open nickbouton opened 10 years ago
Updating the body of reverie_img_unautop()
to look for XHTML-valid <img />
tags seems to do the trick of handling images wrapped in <p></p>
tags but not catching regular images aligned inside of content blocks (which don't need the preprocessing), FWIW.
Probably not perfect as HTML5 allows non-self-closing tags, but works for me as a temporary replacement:
function reverie_img_unautop($pee) {
return preg_replace('/<p>\\s*?(<a .*?><img.*?\/><\\/a>|<img.*?\/>)?\\s*<\\/p>/s',
'<figure class="figure">$1</figure>', $pee);
}
Seems to be present in both Reverie 4 & 5 as the
reverie_img_unautop()
function inclean.php
has not changed.Probably an issue with the regex being too greedy, but if you place an image inside a regular content paragraph with
alignleft
,alignright
, oraligncenter
, the resulting<figure>
tag expands around the next paragraph (or more) of text as well, not just the image, and doesn't close properly until the end of the entry content.Stopgap fix is to remove the
reverie_img_unautop()
function altogether.