Adding style elements to images
I have inline images that I want to have styles applied (most importantly float attributes). In my markdown I'm using this type of syntax:
[![](image_url){: style="float:right"}
However, marked doesn't recognize the style part. Is there a supported way to add CSS styling to images that will work?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 09 Mar, 2015 11:52 AM
The syntax you're using is Kramdown. You can use Kramdown as a custom processor, or you can use MultiMarkdown reference syntax.
![][1]
[1]: image.jpg "title" style="float:left"
2 Posted by graham wheeler on 10 Mar, 2015 04:37 AM
Thanks for the fast response, Brett. Actually this is Python markdown, as I'm writing for the Pelican static site generator.
I tried adding it as a custom processor:
Path: /usr/local/bin/python
Args: -m markdown -x markdown.extensions.attr_list
but it still doesn't work; I see the {:style="float:right"} as text in the result. However:
cat <file> | python -m markdown -x markdown.extensions.attr_list
works fine, so my command line seems right.
Support Staff 3 Posted by Brett on 10 Mar, 2015 01:44 PM
Your custom processor works for me as you describe it.
1. Are you certain it's running based on the green indicator at the
bottom of the preview window?
2. Which version of Marked are you using?
-Brett
4 Posted by graham wheeler on 10 Mar, 2015 02:00 PM
The green indicator was on. I toggled it off, then on again, and I got a prompt about granting permissions. After clicking on allow it started working. :-)
This is with 2.4.9.
Support Staff 5 Posted by Brett on 10 Mar, 2015 02:07 PM
Glad to hear it. The sandboxing in the MAS version causes a lot of issues with custom processors, but the version in review should improve the situation. Also note there's a cheat in Advanced prefs titled Update Permissions that allows you to grant access to your entire drive.