Skip to content

Move rich topics out of labs / stabilise MSC3765 #29817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ Under the hood this stops Element Web from adding the `perParticipantE2EE` flag

This is useful while we experiment with encryption and to make calling compatible with platforms that don't use encryption yet.

## Rich text in room topics (`feature_html_topic`) [In Development]

Enables rendering of MD / HTML in room topics.

## Enable the notifications panel in the room header (`feature_notifications`)

Unreliable in encrypted rooms.
Expand Down
4 changes: 0 additions & 4 deletions src/HtmlUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,6 @@ export function topicToHtml(
ref?: LegacyRef<HTMLSpanElement>,
allowExtendedHtml = false,
): ReactNode {
if (!SettingsStore.getValue("feature_html_topic")) {
htmlTopic = undefined;
}

let isFormattedTopic = !!htmlTopic;
let topicHasEmoji = false;
let safeTopic = "";
Expand Down
7 changes: 0 additions & 7 deletions test/unit-tests/HtmlUtils-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import { SettingLevel } from "../../src/settings/SettingLevel";
import SdkConfig from "../../src/SdkConfig";

describe("topicToHtml", () => {
afterEach(() => {
SettingsStore.reset();
});

function getContent() {
return screen.getByRole("contentinfo").children[0].innerHTML;
}
Expand All @@ -36,19 +32,16 @@ describe("topicToHtml", () => {
});

it("converts literal HTML topic to HTML", async () => {
SettingsStore.setValue("feature_html_topic", null, SettingLevel.DEVICE, true);
render(<div role="contentinfo">{topicToHtml("<b>pizza</b>", undefined, null, false)}</div>);
expect(getContent()).toEqual("&lt;b&gt;pizza&lt;/b&gt;");
});

it("converts true HTML topic to HTML", async () => {
SettingsStore.setValue("feature_html_topic", null, SettingLevel.DEVICE, true);
render(<div role="contentinfo">{topicToHtml("**pizza**", "<b>pizza</b>", null, false)}</div>);
expect(getContent()).toEqual("<b>pizza</b>");
});

it("converts true HTML topic with emoji to HTML", async () => {
SettingsStore.setValue("feature_html_topic", null, SettingLevel.DEVICE, true);
render(<div role="contentinfo">{topicToHtml("**pizza** 🍕", "<b>pizza</b> 🍕", null, false)}</div>);
expect(getContent()).toEqual('<b>pizza</b> <span class="mx_Emoji" title=":pizza:">🍕</span>');
});
Expand Down
Loading