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

XF 1.5 Adding Custom BB Code

Dan Allen

Active member
#3
Thank you, that helped. I got this to save, but it is not working.

upload_2016-6-30_17-56-42.png

Page source. The message stops with the <sup>
Code:
<div class="messageContent">
<article>
<blockquote class="messageText SelectQuoteContainer ugc baseHtml">
just a test<br />
1.4507x10<sup>
<div class="messageTextEndMarker">&nbsp;</div>
</blockquote>
</article>
</div>
[/code/

[ATTACH=full]136929[/ATTACH]

[ATTACH=full]136928[/ATTACH]
 

Attachments

Mike

XenForo developer
Staff member
#4
You HTML replacement needs to be the HTML that you're replacing the contents of the tag with. In this case, probably:
Code:
<sup>{text}</sup>
 

Dan Allen

Active member
#5
Thank you, the custom bbcode now is behaving the way I need it. There is a complication for enabling superscript text that might be worth having in these notes.

Once the substitution was fixed, the display of superscript <sup> was not in accord with normal css.
It was like this in the Xenforo BBCode help.
upload_2016-7-2_9-27-55.png

This is the page source for that help display showing the <sup> tag substituted for [sup]:
upload_2016-7-2_9-14-55.png


Disabling CSS shows superscript displayed in html default position
upload_2016-7-2_9-30-20.png


This is the CSS governing the vertical alignment of <sup>
in the default xenforo style.
upload_2016-7-2_8-54-33.png
That rule is in the template xenforo_reset.css.

Adding this to EXTRA.css got the result I was looking for:
upload_2016-7-2_8-59-5.png


Result:
upload_2016-7-2_9-33-43.png
 

Attachments

#6
This was very helpful in creating a custom bb code for paragraphs, but there really needs to be a tutorial on what to put in the boxes for creating custom bb code so that it's easy to find the information.