1 (edited by analogue 2005-01-18 05:31)

Topic: Linked img in Preview isn't parsed

Sorry if it's been submitted/fixed already.

On my 1.2 PunBB forums (one english, one french), when I preview a post containing a linked img tage, the preview doesn't parse it (it shows the bb code, and don't inline the image)

Here's an example: http://img23.exs.cx/img23/4251/outrun2052xc.th.jpg

When the previewed post is submitted, everything is fine.

ps: the problem is happening here too wink
ps2: the preview is working fine (inline img) while I'm editing this post

Re: Linked img in Preview isn't parsed

are you using firefox? if so make sure you don't have the box checked next to "for originating website only" under "load images" in the "web features" options tab. if this isn't it then all i can say is it works for me.

~James
FluxBB - Less is more

3

Re: Linked img in Preview isn't parsed

Working fine for me as well, at least in IE6

4 (edited by kiplantt 2005-01-18 12:34)

Re: Linked img in Preview isn't parsed

It work if you use :
[ img ] and [/ img ]

But not if you use :
[ IMG ] and [/ IMG ]

Can you correct that Rickard ? smile

[img]http://www.famfamfam.com/lab/icons/silk/icons/error.png[/img] /me speaks French and bad English [img]http://www.famfamfam.com/lab/icons/silk/icons/error.png[/img]

Re: Linked img in Preview isn't parsed

Dr.Jeckyl wrote:

are you using firefox? if so make sure you don't have the box checked next to "for originating website only" under "load images" in the "web features" options tab. if this isn't it then all i can say is it works for me.

big_smile

kiplantt wrote:

It work if you use :
[ img ] and [/ img ]

But not if you use :
[ IMG ] and [/ IMG ]

Thanks for finding the real but (if it's one) wink

Re: Linked img in Preview isn't parsed

Erm, try clicking on the stuff to the right of the image

Re: Linked img in Preview isn't parsed

Smartys wrote:

Erm, try clicking on the stuff to the right of the image

?

8 (edited by Smartys 2005-01-19 01:24)

Re: Linked img in Preview isn't parsed

Click the grey area to the right of the image: it loads the link for me if you click there, oddly enough

This is what I see when I view source (I'll use some more linebreaks so it's easier to read):

Here's an example:
<a href="http://img23.exs.cx/my.php?loc=img23&image=outrun2052xc.jpg">
</p>
<div class="imgbox"><div class="scrollbox">
<img src="http://img23.exs.cx/img23/4251/outrun2052xc.th.jpg" alt="http://img23.exs.cx/img23/4251/outrun2052xc.th.jpg" />
</div></div>
<p>
</a>

Re: Linked img in Preview isn't parsed

You didn't understand my problem. When I preview my post, the img tag isn't parsed and no image is displayed in the preview, this has nothing to do with my browser.

The bug is still in.

Re: Linked img in Preview isn't parsed

Damn, misread tongue
But I think that would be another bug: shouldn't the image be the link, not the area to the right?

Re: Linked img in Preview isn't parsed

the </a> is after the image so the image is a link

Re: Linked img in Preview isn't parsed

And I might add this has nothing to do with ImageShack, I just took ImageShack to quickly upload a picture and illustrate the bug, it happens with any picture.

13

Re: Linked img in Preview isn't parsed

Connorhd wrote:

the </a> is after the image so the image is a link

The </a> is after the div so the whole damn div is 100% wide link. I think the help file needs to be updated to specify which tags can be nested and which can't. This combination can't.

I'm beginning to wonder whether putting scrolls around images is worth the bother. Maybe much better just to crop all large images at the right hand edge and have them all as clickable links so you can see the whole pic in a new window. Alternatively, add an "=link" attribute to the bbcode <img> so it is made clickable automatically without needing to nest it.

Re: Linked img in Preview isn't parsed

Hmm, that is a problem. Clicking images to see them full sized won't help because what will happen if you wrap one of those images in an url tag? Gah! I figured this problem was finally solved and now it hits you right back in the face again. Not "allowing" people to make image links is not a solution either. Adding a variant of the img tag with =link is possible, but I'm afraid most people would, not knowing the tag variant even existed, still try to wrap the image in regular url tags.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

15

Re: Linked img in Preview isn't parsed

The only solution, which is horribly complicated, is if somebody tries to nest it this way then parser get rid of the <a>tags inserted by the url bbcode and insert <a>tags around the image instead. In other words, parser manipulates a combination of nested url and img tags as one unit.

I forgot to mention that this problem also breaks the validator because the tags are not properly nested. bbcode img starts by closing the preceding pargraph so you end up with

<a href=""></p>............................</a><p>

Re: Linked img in Preview isn't parsed

Yes, I noticed. We'll have to give it some thought. Maybe scrapping the containing div and thus the scrollbars is the only solution.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

17

Re: Linked img in Preview isn't parsed

I'm beginning to see the attractions of javascript.

if img wider than div
- stick width on img
else
- just show it.

Only joking

Re: Linked img in Preview isn't parsed

Sure. I'm no JavaScript wiz though smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Linked img in Preview isn't parsed

Ah, come on. Javascript is easy. I can look into it if you want...

20

Re: Linked img in Preview isn't parsed

Put it on hold for a while. I'm thinking.

21

Re: Linked img in Preview isn't parsed

This problem is really simple to fix in Gecko and Opera. Get rid of all the scrolling stuff and just display the basic <img> tags. Put max-width: 100% on the image and it scales to fit. Small images are not affected.

The catch is of course that IE doesn't do max-width.

Re: Linked img in Preview isn't parsed

Hmm. I really liked that idea.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

23

Re: Linked img in Preview isn't parsed

Me too. It looks great in Firefox and uses a lot less markup than scrolling but IE just shows the image full size and crops it with overflow. There is no way around that apart from using minmax.js which forces IE to emulate max-width, min-width etc.

Re: Linked img in Preview isn't parsed

According to this page, using minmax.js is only a matter of including that file in the header. We could do that only for IE. I was kind of hoping to not have to do browser-specific output, but I guess we really have no choice.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Linked img in Preview isn't parsed

kiplantt wrote:

It work if you use :
[ img ] and [/ img ]

But not if you use :
[ IMG ] and [/ IMG ]

Can you correct that Rickard ? smile

Fix.

"Programming is like sex: one mistake and you have to support it for the rest of your life."