Move rich topics out of labs / stabilise MSC3765 (#29817)

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
Johannes Marbach
2025-04-28 18:05:36 +02:00
committed by GitHub
parent c3c04323e1
commit 160a7c1ae3
3 changed files with 0 additions and 15 deletions

View File

@@ -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. 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`) ## Enable the notifications panel in the room header (`feature_notifications`)
Unreliable in encrypted rooms. Unreliable in encrypted rooms.

View File

@@ -480,10 +480,6 @@ export function topicToHtml(
ref?: LegacyRef<HTMLSpanElement>, ref?: LegacyRef<HTMLSpanElement>,
allowExtendedHtml = false, allowExtendedHtml = false,
): ReactNode { ): ReactNode {
if (!SettingsStore.getValue("feature_html_topic")) {
htmlTopic = undefined;
}
let isFormattedTopic = !!htmlTopic; let isFormattedTopic = !!htmlTopic;
let topicHasEmoji = false; let topicHasEmoji = false;
let safeTopic = ""; let safeTopic = "";

View File

@@ -17,10 +17,6 @@ import { SettingLevel } from "../../src/settings/SettingLevel";
import SdkConfig from "../../src/SdkConfig"; import SdkConfig from "../../src/SdkConfig";
describe("topicToHtml", () => { describe("topicToHtml", () => {
afterEach(() => {
SettingsStore.reset();
});
function getContent() { function getContent() {
return screen.getByRole("contentinfo").children[0].innerHTML; return screen.getByRole("contentinfo").children[0].innerHTML;
} }
@@ -36,19 +32,16 @@ describe("topicToHtml", () => {
}); });
it("converts literal HTML topic to HTML", async () => { 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>); render(<div role="contentinfo">{topicToHtml("<b>pizza</b>", undefined, null, false)}</div>);
expect(getContent()).toEqual("&lt;b&gt;pizza&lt;/b&gt;"); expect(getContent()).toEqual("&lt;b&gt;pizza&lt;/b&gt;");
}); });
it("converts true HTML topic to HTML", async () => { 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>); render(<div role="contentinfo">{topicToHtml("**pizza**", "<b>pizza</b>", null, false)}</div>);
expect(getContent()).toEqual("<b>pizza</b>"); expect(getContent()).toEqual("<b>pizza</b>");
}); });
it("converts true HTML topic with emoji to HTML", async () => { 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>); 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>'); expect(getContent()).toEqual('<b>pizza</b> <span class="mx_Emoji" title=":pizza:">🍕</span>');
}); });