feat(Markdown): enhance Markdown rendering options and use exact whitespace instead normalizing

This commit is contained in:
Pragadesh-45
2025-10-09 23:33:55 +05:45
parent cf17539a47
commit 98cb2df3fe
2 changed files with 11 additions and 0 deletions

View File

@@ -78,6 +78,14 @@ const StyledMarkdownBodyWrapper = styled.div`
background-color: ${(props) => props.theme.bg};
}
}
p {
white-space: pre-wrap;
}
div {
white-space: pre-wrap;
}
}
`;

View File

@@ -6,6 +6,9 @@ import { isValidUrl } from 'utils/url/index';
const Markdown = ({ collectionPath, onDoubleClick, content }) => {
const markdownItOptions = {
html: true,
breaks: true,
linkify: true,
replaceLink: function (link, env) {
return link.replace(/^\./, collectionPath);
}