XF 2.1 Custom bbcode for HR (horizontal line) RESOLVED

djbaxter

in memoriam 1947-2022
If I create a custom bbcode called HR with the replacement <hr> it correctly inserts a horizontal line

BUT:
  1. any text following the HR is not displayed although I can still see it in edit mode; and
  2. Xenforo erroneously "closes" the tag with [/hr] at the end of the post.
This is the settings page:

202037
202038
202039
202040
 
I think this is not a Xenforo bug just a limitation of how bbcode works, if there isn't a closing tag it will make one

For it to work you have to have a closing bbcode when you post or else it gets added after the text.

This will work.

Code:
Text here
[hr][/hr]
More text here

Obviously users probably won't know that it therefore makes most sense if you have a text editor icon for the bbcode which will automatically enter opening and closing tags,


202078


202075
 
Last edited:
Found this:

Differences Between HTML 4.01 and HTML5

In HTML5, the <hr> tag defines a thematic break.

In HTML 4.01, the <hr> tag represents a horizontal rule.

However, the <hr> tag may still be displayed as a horizontal rule in visual browsers, but is now defined in semantic terms, rather than presentational terms.

All the layout attributes are removed in HTML5. Use CSS instead.
 
One annoying thing about this is that if you invoke the bbcode via an icon in the text editor, the cursor will be there blinking between the [hr] and the [/hr] so tempting your users to put the next text there as opposed to after the [/hr]

I doubt this is a xenforo issue though. In fact I found the solution above from a phpbb support posts. (Sorry again about missing the advanced html parameter!)
 
Back
Top Bottom