This website works better with JavaScript.
Home
Explore
Help
Register
Sign In
kiduc
/
bibiuc.com
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
59
Wiki
Activity
Browse Source
Images with nonempty alt text, occurring by itself in a paragraph, will be rendered as figure with a caption, like pandoc's markdown (see <
https://pandoc.org/MANUAL.html#images
>). This is controlled with a new configuration option `fig.captions`.
pull/394/head
Stefan Björk
6 years ago
parent
013c18e975
commit
9f1874345a
1 changed files
with
5 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+5
-0
system/includes/functions.php
+ 5
- 0
system/includes/functions.php
View File
@ -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
{
Write
Preview
Loading…
Cancel
Save