Skip to content
Merged
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
21 changes: 19 additions & 2 deletions dotcom-rendering/src/components/TagPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const titleContainerStyle = css`
`;

const paragraphStyle = css`
${headlineMedium17}
${headlineMedium17};
color: ${palette.neutral[46]};
`;

Expand All @@ -208,6 +208,19 @@ const linkStyles = css`
border-bottom: 1px solid ${palette.brand[500]};
`;

const pStyles = css`
margin-bottom: ${space[1]}px;
b,
strong em,
strong u {
font-weight: bold;
}

i {
font-style: italic;
}
`;

const buildElementTree = (node: Node): ReactNode => {
if (isElement(node)) {
switch (node.nodeName) {
Expand All @@ -220,6 +233,11 @@ const buildElementTree = (node: Node): ReactNode => {
});
case 'BR':
return jsx('br');
case 'P':
return jsx('p', {
css: pStyles,
children: Array.from(node.childNodes).map(buildElementTree),
});
default:
return jsx(node.tagName.toLowerCase(), {
children: Array.from(node.childNodes).map(buildElementTree),
Expand Down Expand Up @@ -278,7 +296,6 @@ export const TagPageHeader = ({ title, description, image }: Props) => {
const descriptionFragment = description
? parseHtml(description)
: undefined;

return (
<section css={[fallbackStyles, containerStyles]}>
<div css={[decoration, sideBorders]} />
Expand Down