Move rich topics out of labs / stabilise MSC3765 (#29817)
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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 = "";
|
||||||
|
|||||||
@@ -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("<b>pizza</b>");
|
expect(getContent()).toEqual("<b>pizza</b>");
|
||||||
});
|
});
|
||||||
|
|
||||||
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>');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user