What is the discourse markdown syntax to add a title to an image?
I recenently asked in another topic but the question hasn’t been answered yet.
@zogstrip do we have provisions for this, what happens if you enter the image tag manually and set
Why, adding title already works with existing Markdown syntax.
That title is just a mouseover. I don’t think it would work on mobile.
I’m interested in placing a static title under each picture here:
It works as expected
I know some text-pre-processors have support for image labeling, but then again, markdown isn’t Latex on purpose.
What I am currently thinking is that this could easily be a (JS) plugin, which reads the “title”-tag of an image in the cooked-data and wrap each one into the appropriate
<figure><figcaption></figcaption></figure>-tags. Then throw some CSS as it to make it look pretty and there you go.
That said. Can’t we already do this even? Here is what this
<figure><img src='//discourse-meta.s3-us-west-1.amazonaws.com/original/2X/3/39239a7f2b0f0aa72bdd0d3c1880f15f1a967276.png'><figcaption>The discourse logo</figcaption></figure>
looks like rendered:The discourse logo
look at that. HTML5 is just awesome.
The only way at the moment is to not paste, but upload a file (or drag and drop) – the filename will be displayed. Like so:
Pasted images will always say “pasted image”, but uploaded or drag-n-drop files will show the filename in the lightbox.
I realized that using
<figcaption> in a post doesn’t render properly (the caption appears next to instead of under the image, like this:
The reson for this is that the figcaption tags seem to be simply stripped away:
So I’m guessing this has something to to with it not being whitelisted?
Is there any risk whith whitelisting that tag? Would be great to be able to use it.
Just to be clear: what I meant was “could the tag please be whitelisted by default in discourse core?”
If I can do this myself on my instance, I’d appreciate some hints about how to do it
Markdown syntax is now used for images as of Discourse 1.9 as I recall… refer to http://commonmark.org/help
The original filename was indeed
kanye-west-crazy-eye.jpg, but we should see an effect from editing to
![YOUR TEXT HERE|361x500](upload://ciOh12NkCh4K76Ogc2ypZOg54ov.jpg)
Let me try this:
![Logo] : //discourse-meta.s3-us-west-1.amazonaws.com/original/3X/f/7/f7a6164ffa55af4ee2706d2386227183ef6c2d61.png "Creative Commons licensed"
That works because it’s a small (and remote) image that is not lightboxed, though.