Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Markdown image classes not working

Started by Muut Archive 10 years ago · 2 replies · 699 views
10 years ago

Hello, I'm trying to right-align and center some images in my markdown blog articles, so according to the doc I added classes like "float-right" and "image-center" to my site scss/css and then in an item.md I have:

TXT
![Difference]jmt2_diff.png?classes=float-right)

(Except I actually have a ( after [Difference], but doing so in the forum here replaces part of my code with a camera icon.)

The problem is that in the HTML output, it keeps the "classes" part as a query string on the processed image, instead of assigning it to a class attribute on the img element:

TXT
<img style="" alt="Difference" src="/images/e/5/d/1/b/e5d1ba21dd307f6df57e59f597a72265aaf0fb74-jmt2di ff.png?classes=float-right">

Any ideas?
I'd tell you which version of Grav I have (it's from a few months ago i think) but not sure where to find that.
Thanks.

10 years ago

FYI, in the future put your code in between triple backticks (see the question mark on the top-right of the input box).

The problem is the version of your Grav. This functionality was added only a few weeks ago.

To find out your Grav version simply type:

BASH
$ bin/gpm version

In your console. Or you can manually look at the version in the system/defines.php file.

The latest version is 1.0.10 at the time of this writing.

10 years ago

Ah. Upgrading to 1.0.10 worked like a charm. Thank you!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1357 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago