Skip to content

Commit

Permalink
feat(information): utilisation de tiptap sur les pages infos (#6362)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot authored Dec 18, 2024
1 parent dc686a7 commit 9bbdd41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toUrl, xssWrapper } from "../../lib";
import { toUrl } from "../../lib";
import ImageWrapper from "../../common/ImageWrapper";

import {
Expand All @@ -9,6 +9,7 @@ import {
Wrapper,
} from "@socialgouv/cdtn-ui";
import styled from "styled-components";
import DisplayContentContribution from "../../contributions/DisplayContentContribution";

export const BlockGraphic = ({ block }) => {
const { imgUrl, altText, fileUrl, html: htmlGraphic, size } = block;
Expand All @@ -29,10 +30,9 @@ export const BlockGraphic = ({ block }) => {
</Button>
</DownloadWrapper>
<MoreContent noLeftPadding title="Voir en détail">
<Wrapper
variant="dark"
dangerouslySetInnerHTML={{ __html: xssWrapper(htmlGraphic) }}
></Wrapper>
<Wrapper variant="dark">
<DisplayContentContribution content={htmlGraphic} titleLevel={3} />
</Wrapper>
</MoreContent>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styled from "styled-components";
import { BlockGraphic } from "./BlockGraphic";
import { ContentList } from "../../content";
import Html from "../../common/Html";
import DisplayContentContribution from "../../contributions/DisplayContentContribution";

export const BlockList = ({
blocks,
Expand All @@ -30,7 +31,12 @@ export const BlockList = ({
);
break;
case EditorialContentType.markdown:
comp = <Html>{block.html}</Html>;
comp = (
<DisplayContentContribution
content={block.html}
titleLevel={2}
></DisplayContentContribution>
);
break;
}
return (
Expand Down

0 comments on commit 9bbdd41

Please sign in to comment.