Center align images

(Shalin TJ) #1

I understand Markdown does not support center-aligning images. Having said that, on our forum we would like to center align images as and when required. I added the following css (via Admin >> Customise):


And then added the “centerimg” class to the images but the images didn’t align to center. Where did I go wrong?

(Simon Cossar) #2

Your class is getting stripped out by the Discourse markdown parser. You can do this with a plugin. Here’s one that I have been working on. It needs to be updated to work with the new plugin api. I’ll do that in the next couple of days, and add some better documentation.

(Shalin TJ) #3

Awesome… Let me know once it’s ready as per the new plugin API guidelines…



(Simon Cossar) #4

It should be good to go now. It’s tested against the current master branch of Discourse. I haven’t tested it against the stable branch, but that should be ok as well.