XF 1.5 Adding Custom BB Code

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

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

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

  • upload_2016-6-30_17-45-7.webp
    upload_2016-6-30_17-45-7.webp
    28.1 KB · Views: 20
  • upload_2016-6-30_17-45-27.webp
    upload_2016-6-30_17-45-27.webp
    13.5 KB · Views: 21
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>
 
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.webp

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


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


This is the CSS governing the vertical alignment of <sup>
in the default xenforo style.
upload_2016-7-2_8-54-33.webp
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.webp


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

Attachments

  • upload_2016-7-2_8-46-6.webp
    upload_2016-7-2_8-46-6.webp
    5.2 KB · Views: 15
  • upload_2016-7-2_8-49-11.webp
    upload_2016-7-2_8-49-11.webp
    6 KB · Views: 10
  • upload_2016-7-2_9-14-23.webp
    upload_2016-7-2_9-14-23.webp
    5.8 KB · Views: 9
  • upload_2016-7-2_9-26-4.webp
    upload_2016-7-2_9-26-4.webp
    11.7 KB · Views: 11
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.
 
Top Bottom