mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 21:46:22 +05:30
Merge pull request #394 from bluebirch/fig_captions
Fig captions by @bluebirch
This commit is contained in:
commit
8ca4b3b625
1 changed files with 5 additions and 0 deletions
|
|
@ -360,6 +360,11 @@ function get_posts($posts, $page = 1, $perpage = 0)
|
|||
// Get the contents and convert it to HTML
|
||||
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
|
||||
|
||||
// Convert image tags to figures
|
||||
if (config('fig.captions') == 'true') {
|
||||
$post->body = preg_replace( '/<p>(<img .*?alt="(.*?)"\s*\/>)<\/p>/', '<figure>$1<figcaption>$2</figcaption></figure>', $post->body );
|
||||
}
|
||||
|
||||
if (config('views.counter') == 'true') {
|
||||
$post->views = get_views($post->file);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue