feat: md icon prefix
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {createMemo, For} from 'solid-js';
|
||||
import { marked } from '../../markdown';
|
||||
import {parseMarkdown} from '../../markdown';
|
||||
import { getLayerStyle } from './hooks/dimensions';
|
||||
import type { CardData } from './types';
|
||||
import {DeckStore} from "./hooks/deckStore";
|
||||
@@ -16,7 +16,7 @@ export function CardLayer(props: CardLayerProps) {
|
||||
const showBounds = () => props.store.state.isEditing;
|
||||
|
||||
function renderLayerContent(content: string) {
|
||||
return marked.parse(processVariables(content, props.cardData, props.store.state.cards)) as string;
|
||||
return parseMarkdown(processVariables(content, props.cardData, props.store.state.cards), props.cardData.iconPath) as string;
|
||||
}
|
||||
return (
|
||||
<For each={layers()}>
|
||||
|
||||
@@ -269,7 +269,22 @@ export function createDeckStore(
|
||||
|
||||
const generateCode = () => {
|
||||
const layersStr = formatLayers(state.layerConfigs);
|
||||
return `:md-deck[${state.rawSrc || state.src}]{size="${state.sizeW}x${state.sizeH}" grid="${state.gridW}x${state.gridH}" bleed="${state.bleed}" padding="${state.padding}" layers="${layersStr}"}`;
|
||||
const parts = [
|
||||
`:md-deck[${state.rawSrc || state.src}]`,
|
||||
`{size="${state.sizeW}x${state.sizeH}"`,
|
||||
`grid="${state.gridW}x${state.gridH}"`
|
||||
];
|
||||
|
||||
// 仅在非默认值时添加 bleed 和 padding
|
||||
if (state.bleed !== DECK_DEFAULTS.BLEED) {
|
||||
parts.push(`bleed="${state.bleed}"`);
|
||||
}
|
||||
if (state.padding !== DECK_DEFAULTS.PADDING) {
|
||||
parts.push(`padding="${state.padding}"`);
|
||||
}
|
||||
|
||||
parts.push(`layers="${layersStr}"}`);
|
||||
return parts.join(' ');
|
||||
};
|
||||
|
||||
const copyCode = async () => {
|
||||
|
||||
Reference in New Issue
Block a user