• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug [IMG] content being visually rendered when inside [CODE=rich] tag

CTXMedia

Formerly CyclingTribe
#1
I came across this one whilst helping a member with their mileage signature ticker on CycleChat.

When using [ IMG ] tags inside of [ CODE=rich ] container the image is visually rendered instead of the text being shown.

See this thread for an examples: http://xenforo.com/community/threads/code-rich-test.59198/

Some test text:


Hopefully this will render plain but here's some test content to replicate it:

Regular [ code] tag:
[code]
[IMG]http://veloviewer.com/SigImage.php?a=1348e4&r=2&c=4&u=I&g=n&f=jilnozzzzz&z=a.png[/IMG]
[/code]

Rich [ code] tag:
[code=rich]
[IMG]http://veloviewer.com/SigImage.php?a=1348e4&r=2&c=4&u=I&g=n&f=jilnozzzzz&z=a.png[/IMG]
[/code]


... and here's how it looks:

Regular [ code] tag:
Code:
[IMG]http://veloviewer.com/SigImage.php?a=1348e4&r=2&c=4&u=I&g=n&f=jilnozzzzz&z=a.png[/IMG]
Rich [ code] tag:
Code:
	
 

Jeremy

Well-known member
#2
I wouldn't exactly classify this as a bug, since the styling and JavaScript constrain it to the containing element. You can still expand it. But Mike & Kier will decide.
 

CTXMedia

Formerly CyclingTribe
#3
I wouldn't exactly classify this as a bug, since the styling and JavaScript constrain it to the containing element. You can still expand it. But Mike & Kier will decide.
It's not really about containment, but about rendering. Surely any text inside a [ CODE ] wrapper should strictly display as text?
 

CTXMedia

Formerly CyclingTribe
#5
If you specify rich, it renders BBCode. Which is expected to render an IMG tag.
I understood rich as applying text formatting, such as bold, colour, etc. not rendering the content of the pasted code.

I'd specifically used =rich to highlight the BBCode error to my member when they'd added their ticker code - putting the [ IMG ] tag in bold and expecting the resulting text to be in bold in the code view.

I'm pretty sure that's how the previous editor worked - so perhaps it's an old habit from the old editor that I just need to get out of? :)
 

CTXMedia

Formerly CyclingTribe
#6
Hmmm ... okay, having tested this on an XF 1.x site it does the same thing so perhaps this is a perception thing (mine) and I should be using something else instead??!! ;)

In which case, how would I render the text of [ IMG ] BBCode with some textual formatting to highlight parts of the code? (Perhaps is just isn't possible, given the combination of displaying the BBCode as text as well as using it for formatting [my head is beginning to hurt trying to work it out ... :confused:]).
 

CTXMedia

Formerly CyclingTribe
#8

[IMG]http://veloviewer.com/SigImage.php?a=1348e4&r=2&c=4&u=I&g=n&f=jilnozzzzz&z=a.png[/IMG]


Unfortunately it doesn't allow text to be formatted - any formatting is removed on post.

This is a screenshot of what I'm trying to achieve and it just seems impossible:

upload_2013-9-7_2-11-15.png
 
Last edited:

CTXMedia

Formerly CyclingTribe
#10
So, using PLAIN to break the code (and render it, well, renderless ... lol) you can then format the before and after parts and they seamlessly join when posted?
Code:
[IMG]http://veloviewer.com/SigImage.php?a=1348e4&r=2&c=4&u=I&g=n&f=jilnozzzzz&z=a.png[/IMG]
Genius - thanks @Jeremy :D