File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import style from '../index.css?raw'
1010import katex from '../katex.css?raw'
1111import { layoutSSR , renderSSRHTML } from './utils/layout-ssr'
1212import { snapdom } from '@zumer/snapdom'
13+ import type { Tokens } from 'marked'
1314import { marked } from 'marked'
1415
1516interface Window {
@@ -48,7 +49,7 @@ const options: Options = {
4849 markdown : ( text : string ) => {
4950 // Configure marked renderer to add target="_blank" to links
5051 const renderer = {
51- link ( token : any ) {
52+ link ( token : Tokens . Link ) {
5253 const href = token . href || ''
5354 const title = token . title ? ` title="${ token . title } "` : ''
5455 const text = token . text || ''
Original file line number Diff line number Diff line change @@ -190,10 +190,10 @@ export const renderSSRHTML = function (
190190 const tagsHtml = node . tags
191191 . map ( tag => {
192192 if ( typeof tag === 'string' ) {
193- // 兼容原来的字符串配置
193+ // Compatible with legacy string configuration
194194 return `<span class="me-tag">${ escapeHtml ( tag ) } </span>`
195195 } else {
196- // 支持对象配置
196+ // Support object configuration
197197 let classAttr = 'me-tag'
198198 if ( tag . className ) {
199199 classAttr += ` ${ tag . className } `
@@ -204,7 +204,7 @@ export const renderSSRHTML = function (
204204 const styles = Object . entries ( tag . style )
205205 . filter ( ( [ _ , value ] ) => value !== undefined && value !== null && value !== '' )
206206 . map ( ( [ key , value ] ) => {
207- // 将驼峰命名转换为CSS属性名
207+ // Convert camelCase to CSS property name
208208 const cssKey = key . replace ( / ( [ A - Z ] ) / g, '-$1' ) . toLowerCase ( )
209209 return `${ cssKey } : ${ value } `
210210 } )
You can’t perform that action at this time.
0 commit comments