Skip to content

[Superseded] Restore BBCode compatibility with current Discourse - #151

Closed
Mondrethos wants to merge 1 commit into
mainfrom
fix/discourse-bbcode-integration
Closed

Mondrethos wants to merge 1 commit into
mainfrom
fix/discourse-bbcode-integration

Conversation

@Mondrethos

@Mondrethos Mondrethos commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Previously, this PR combined CI maintenance, admin updates, Markdown integration, disclosure behavior, BBScript cleanup, and layout fixes in one review.

This work is superseded by independent PRs for standard CI, admin refresh, Markdown integration, disclosures, BBScript cleanup, and layouts, all targeting main and sharing the same CI maintenance so no feature PR requires another feature PR to merge first.

@Mondrethos
Mondrethos requested a review from Alteras1 September 17, 2026 20:11

/**
* @param {MouseEvent} ev
* @param {Slide} slide

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we lose animation by relying on native behavior?

*/
import { withPluginApi } from "discourse/lib/plugin-api";

/**

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we storing the slide?

import { withPluginApi } from "discourse/lib/plugin-api";
/* global bbscriptParser */

/**

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we storing which posts are decorated?


/**
* Check if the post is a preview. If it is a preview, debounce the function
* @param {HTMLElement} post

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what events do we need to abort?

const pendingDecorations = new WeakMap();
const scrollableOverflow = new Set(["auto", "scroll"]);

export function decorateBBCodeScrollers(post) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for?

Comment thread bbcode-src/tags/list.js

// XenForo's [*] is an item separator, not a paired BBCode tag. Split only
// strings here so nested lists and formatting nodes stay inside their item.
export const list = (node, options) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? i thought we agreed we're ditching xf lists and using discourse lists?

Comment thread bbcode-src/tags/table.js
import { preprocessAttr, toNode, toRawTag } from "../utils/common";

// These are the variants supported by RpNation's XenForo table stylesheet.
const TABLE_STYLE = /^(?:(?:none|dotted|dark)(?:-zebra2?)?|zebra2?)$/;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought we agreed we're using discourse tables?

raw = raw.replaceAll(uuid, content);
// These examples bypass Markdown's text renderer while hoisted. Escape
// them when restoring them, so HTML examples stay text inside code/plain.
const escaped = content

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discourse has valid html elements that gets rendered directly, like <details> and <!-- --> comments

// any closing tag. Long, historically valid XenForo layouts can therefore
// disappear entirely. Use its tokenizer extension to close missing children
// before their ancestor, and finish every remaining wrapper at EOF.
export function createLegacyTokenizer(input, options) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WE NEED TO STOP SUPPORTING THIS. this is causing the current RTE nightmare in xenforo

Comment thread yarn.lock
"@bbob/types" "*"

"@bbob/parser@*":
"@bbob/parser@*", "@bbob/parser@4.2.0":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@Alteras1

Copy link
Copy Markdown
Collaborator

this PR needs to be broken down into multiple PRs with individual focuses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants