Support for empty self-closing tags like [hr/]

Created on 18 March 2022, over 2 years ago
Updated 1 February 2023, over 1 year ago

Problem/Motivation

For some background on my motivation, please see Ticket #3270149 β†’ .
In some places, I'm using Bbcode [hr] to divide content. This tag is not provided by xbbcode.

I tried to add it, but the mechanism for that only accepts paired tags.

The sample code should contain a valid example of the tag.

I tried to fake it by entering a paired [hr]...[/hr], but using that would require changing all occurrences of a singular [hr] in my texts. I could just as well use <hr>. I even tried to add a standard/config/install/xbbcode.tag.hr.yml. No dice.

Since I have mass-edited my texts for the Drupal 7 -> 9 transition using either SQL, sometimes resorting to REGEXP, sometimes even to exporting a table for editing with sed and importing the result, I'll do a simple replace run for [HR]-><hr>.

But it would be nice to stay with the BBCode syntax, even though [hr] is not in the BBCode tags reference. But so is your changed [table] syntax.

Steps to reproduce

Try to add s singular [hr] tag on the "Custom BBCode tags" page.

Proposed resolution

Low effort: add an [hr] tag in the "Standard tags" package.
Big(?) effort: add a mechanism that allows adding singular tags. This is probably equivalent to XHTML support, since that allows any tag to be singular by add a slash at the end.
Honestly, I think the "small effort" would suffice. But not having [hr] wouldn't hurt.

Remaining tasks

All of it.

User interface changes

Small effort: [hr[ is available, no changes apart from that.
Big effort: a new version of the "Create custom tag" that can be switched to singular tags.

API changes

None.

Data model changes

Dunno.

✨ Feature request
Status

Fixed

Version

5.0

Component

Custom tags

Created by

πŸ‡©πŸ‡ͺGermany lupe_christoph

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024