优化模版
This commit is contained in:
parent
069bef146a
commit
35177445af
@ -52,8 +52,9 @@ export const templates: Template[] = [
|
||||
lineHeight: 1.2
|
||||
},
|
||||
p: {
|
||||
fontSize: '15px',
|
||||
margin: '1.5em 8px',
|
||||
lineHeight: 1.75,
|
||||
lineHeight: 2,
|
||||
letterSpacing: '0.1em',
|
||||
color: 'hsl(var(--foreground))',
|
||||
textAlign: 'justify'
|
||||
@ -98,6 +99,7 @@ export const templates: Template[] = [
|
||||
borderRadius: '4px'
|
||||
},
|
||||
link: {
|
||||
fontSize: '15px',
|
||||
color: '#576b95'
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,6 @@ function baseStylesToString(base: RendererOptions['base'] = {}): string {
|
||||
if (base.primaryColor) {
|
||||
styles.push(`--md-primary-color: ${base.primaryColor}`)
|
||||
}
|
||||
if (base.textAlign) {
|
||||
styles.push(`text-align: ${base.textAlign}`)
|
||||
}
|
||||
if (base.lineHeight) {
|
||||
styles.push(`line-height: ${base.lineHeight}`)
|
||||
}
|
||||
@ -103,7 +100,8 @@ export function convertToWechat(markdown: string, options: RendererOptions = def
|
||||
customRenderer.heading = function({ text, depth }: Tokens.Heading) {
|
||||
const style = {
|
||||
...mergedOptions.block?.[`h${depth}`],
|
||||
color: mergedOptions.base?.themeColor // 使用主题颜色
|
||||
color: mergedOptions.base?.themeColor, // 使用主题颜色
|
||||
textAlign: mergedOptions.base?.textAlign // 添加文本对齐
|
||||
}
|
||||
const styleStr = cssPropertiesToString(style)
|
||||
const tokens = marked.Lexer.lexInline(text)
|
||||
|
Loading…
Reference in New Issue
Block a user