[wrap]-token issue in rich text editor in 3.5.0 revisited | What should I do instead?

AI-generated summary

Users are discussing issues with the [wrap] token in Discourse’s new rich text editor (RTE) introduced in version 3.5.0. janbolmeson reports that [wrap] tokens (e.g., [wrap=lead] or [wrap=alert]) fail in RTE mode, causing token errors and rendering nothing, though they work in Markdown mode. The team acknowledges the issue, with lindsey confirming plans to add [wrap] support to the RTE, though no ETA is available. janbolmeson expresses appreciation for the team’s work and notes the Markdown workaround suffices for now. Another user, nordize, initially misattributes an RTE error to the [details] tag but later clarifies it stems from the LaTeX plugin (using KaTeX), where even simple $1$ triggers the error. renato confirms [details] is supported and asks for a minimal reproduction case. Separately, jrgong inquires about forcing Markdown mode via URL for new topics using [wrap] tokens; renato notes no direct override exists, but the editor now auto-switches to Markdown when unsupported features (like [wrap]) are detected — a behavior jrgong confirms. Finally, renato announces [wrap] is now supported in the RTE and closes the topic, inviting users to report new issues.

I have tried to get up to speed with the [wrap]-issue in the new editor in 3.5.0. I understand the workaround to use markup-mode as stated e.g. in

But I still don’t understand how I should replace it / what to do instead?

E.g. we use it extensively for thing such as:

[wrap=lead]
Lead paragraph in article with different styling.
[/wrap]

or

[wrap=alert]
Alert in a form of banner. 
[/wrap]

As said, it works in markdown-mode. But in the new rich editor mode it does not (gives the Token-error described in other posts) and nothing is shown at all.

Is there an other way to solve our use case now in 3.5.0?

Hi @janbolmeson

We’re discussing this internally at this moment. Stay tuned for updates :slight_smile:

2 Likes

@janbolmeson Thanks for your patience; we’re planning to add support for [wrap] tokens in the rich text editor, but we will need some time to get this right. I don’t have an ETA for when this will be ready but we will reach out with updates when they’re available.

5 Likes

That’s totally fine. I am very happy with the work you guys are doing. :heart:

And, there is a workaround, so all is well.

Thx for getting back!

4 Likes

I’m having the same issue with the [details] tag, from the Details plugin, which is part of core now … any clues? Is there a way to make it work in the new RTE right now?

Interestingly, it gives that error even in posts where I didn’t include any [details] tag.

Using 3.5.1

[details] is supported, this is a strong indication that it’s not the content type causing the problem in your document.

Summary

This text will be hidden

Can you share a minimal example that triggers the message?

Oops, apologies, it’s the Latex plugin, not the Details plugin. As soon as I add $1$ then trying to switch to the RTE gives that error.

The Latex plugin is also now part of core. I’m using the Katex variant (not Mathjax).

When creating a new topic via URL, is there any way to override the site setting for default editor and force the composer to open in Markdown mode? We are currently using external forms to generate new-topic URLs in which we want to utilize [wrap] containers in the body= parameter.

There isn’t, but I think it’s less disruptive now that the Markdown mode is automatically selected after showing

The rich text editor doesn’t support all features used in this post; switching you to the Markdown editor.

1 Like

Ah thx I actually just realized that it’s just switching back automatically when wrap elements are in th composer content.

[wrap] is now supported on the rich editor, I’m closing this but please feel free to open a new topic if you find any issues.

1 Like