Spoilers not working for external images

markdown-it-review

(@SenpaiMass) #1

Tried.

[spoiler]http://i.imgur.com/zJ4M8Fx.jpg[/spoiler]

[spoiler]https://i.imgur.com/zJ4M8Fx.jpg[/spoiler]

[spoiler][img]http://i.imgur.com/zJ4M8Fx.jpg[/img][/spoiler]

PS: the pic is very lewd be careful when you click it.

http://try.discourse.org/t/testing-spoiler/348

One of our community members reported me about this spoiler not working. After few tests on my community. The image uploaded to my discourse over there the spoiler works perfectly, but external image links do not work.


(@SenpaiMass) #5

Testing

As of now still does not work, apologies for a second post.


(Mittineague) #6

That’s because you’re doing

[spoiler]http://i.imgur.com/zJ4M8Fx.jpg[/spoiler]

instead of

[spoiler]
http://i.imgur.com/zJ4M8Fx.jpg
[/spoiler]

URLs need to start and be on their own line to onebox

EDIT
Sorry. Now I see what you mean. The URL should show beneath the spoiler without it trying to onebox and fail.


(@SenpaiMass) #7

Thanks, I am currently on 1.5 beta 14. I have a question, is the stable version also facing the same problem?


(Mittineague) #8

I don’t know, I always run Master.


(@SenpaiMass) #9

I shifted to stable and i can confirm that the spoiler issue is still the same.


(Tomas Ibarra) #10

Works for me, and works on my locale too!

Maybe fetch and rebase master branch?


(@SenpaiMass) #11

The link is under a spoiler not an image. That is an image, it should be under spoiler.


(Mittineague) #12

If you want an image under the spoiler it needs to be done as I earlier showed.
i.e.
spoiler tag
image URL
end spoiler tag

not
spoiler tag image URL end spoiler tag
on one line


(@SenpaiMass) #13

Yes that works perfectly. But if i am not wrong, the image was under spoiler directly when
spoiler tag image URL end spoiler tag :question:


(Tomas Ibarra) #14

I think that this is a markdown problem, the maintainers are going to move to a new markdown engine, i don’t know when, but @sam and @codinghorror did tell me that several times on some other bug topics… maybe is that


(Jeff Atwood) #15

Hmm yeah this seems impossible at the moment.

https://blog.codinghorror.com/content/images/2017/06/discourse-download-all.png

by itself. But spoilered?


(Jeff Atwood) #16

Aha after it auto-downloads remote image, it works, but not before.


(Robert) #17

Maybe @sam wants to add this bug to CommonMark testing started here! ?


(Sam Saffron) #18

Not sure what the bug is?

[spoiler][img]//discourse-meta.s3-us-west-1.amazonaws.com/original/3X/3/e/3eb3f65132c7443887f24613ec04cd82a633d5ce.jpg[/img][/spoiler]

(Jeff Atwood) #19

Let me see:

https://blog.codinghorror.com/content/images/2017/01/help-keep-your-school-all-american.jpg

As a spoiler:

[spoiler]https://blog.codinghorror.com/content/images/2017/01/help-keep-your-school-all-american.jpg[/spoiler]

I think it has to do with the size of the remote image, such that it won’t be downloaded locally.


(Sam Saffron) #20

I think it’s a onebox edge case… very easy to work around


(Robert) #21

Off-topic:

I’m impressed that you posted that image already 2 weeks ago considering that the idea is trending only now on twitter… :hushed: