mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-12-04 07:10:07 +00:00
91a3cb03c1
mkdir apps/web/scripts
mv scripts/{cleanup.sh,ci_package.sh,copy-res.ts,deploy.py,package.sh} apps/web/scripts
And a couple of gitignore tweaks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
27 lines
822 B
TypeScript
27 lines
822 B
TypeScript
/*
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React from "react";
|
|
import { domToReact, type DOMNode } from "html-react-parser";
|
|
|
|
import { type RendererMap } from "./utils.tsx";
|
|
import Spoiler from "../components/views/elements/Spoiler.tsx";
|
|
|
|
/**
|
|
* Replaces spans with `data-mx-spoiler` with a Spoiler component.
|
|
*/
|
|
export const spoilerRenderer: RendererMap = {
|
|
span: (span, params) => {
|
|
const reason = span.attribs["data-mx-spoiler"];
|
|
if (typeof reason === "string") {
|
|
return (
|
|
<Spoiler reason={reason}>{domToReact(span.children as DOMNode[], { replace: params.replace })}</Spoiler>
|
|
);
|
|
}
|
|
},
|
|
};
|