feat: add image alignment options and enhance image handling in ArticleEditorCanvas

This commit is contained in:
2026-04-05 23:41:58 +08:00
parent b08be076b2
commit fe124b0ba4
8 changed files with 821 additions and 28 deletions
@@ -7,7 +7,7 @@ const props = defineProps<{
}>();
const renderer = new MarkdownIt({
html: false,
html: true,
linkify: true,
breaks: true,
});
@@ -84,6 +84,28 @@ const html = computed(() => renderer.render(props.content || ""));
color: inherit;
}
.markdown-preview :deep(p.article-editor-image) {
margin: 1.25em 0;
}
.markdown-preview :deep(p.article-editor-image[align="left"]) {
text-align: left;
}
.markdown-preview :deep(p.article-editor-image[align="center"]) {
text-align: center;
}
.markdown-preview :deep(p.article-editor-image[align="right"]) {
text-align: right;
}
.markdown-preview :deep(p.article-editor-image img) {
max-width: min(100%, 960px);
border-radius: 16px;
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.markdown-preview :deep(table) {
width: 100%;
margin: 0 0 1em;