Add markup to control alignment of images and text

This image should explain it all


Here is the code (this actually pastes differently here, but the same thing happens with the text)

[img]https://cdn1.iconfinder.com/data/icons/windows-8-metro-style/32/info.png[/img] Information
----

I don’t understand what you are talking about? That (i) glyph appears nowhere in Discourse?

Oh you expect images to line up with the text. No, that is not supported. Sorry. If you size the image “just right” it might though.

Why is it not supported? Obviously I can resize images to make it work, but that is a tremendous amount of work in the long run.

1 Like

Your example is flawed. If the text includes a character that goes below the baseline (such as g or y), you would find that the text and image actually are vertically centered, like so:

1 Like

Interesting discovery. Unfortunately that would be useless most of the time :\

The intent of the editor markup (Markdown, primarily, with some fallback support for BBCode) is not to be a comprehensive, PDF or TeX like layout engine with really precise control over exactly how things display.

It’s more like a Wikipedia article kind of formatting.

Where exactly are you seeing problem behavior? Your “this image should explain it all” post doesn’t explain where you’re encountering issues. Is this a problem you’re seeing when inlining images in posts, or with badging on the topic lists, or…what?

Then why is it being used for a forum system? :disappointed:. It’s really frustrating how limited Discourse is at large. Less choice is never a good thing. Like lack of tables because “they aren’t needed.”

I’m creating headers for threads. It’s in a thread. Unfortunately I couldn’t post it to show you, because of the image restrictions on new users.

In that case, you might have better luck picking out the ID or class of the header text and adding some padding to it. The only problem is that as @elberet noted, words containing glyphs with both descenders and ascenders will then be mis-aligned.

This isn’t a Discourse problem so much as it is an HTML rendering problem.

That’s an awfully broad generalization based on “I want TeX / PDF like layout control over image alignment in posts”.

However, if you are building a theme for Discourse, as @Lee_Ars pointed out you can use whatever HTML you want.

Yes, the alignment of images and such is too much to ask, to be sure. I didn’t understand that it wasn’t purely the fault of HTML. I was referring more to things like: no tables, no underline, no ability to remove click counters, etc. I know two of those are problems with vanilla markdown, but still. BBcode has them.

Supporting tables and automagically detecting baseline alignment in inline pictures are of vastly different scope… and while the latter would be completely out of place in a discussion forum, having tables sure would be nice, tho. :smirk:

Too bad I suck with JavaScript.