File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -408,6 +408,11 @@ function safeBodyFontSize(options: DcExportOptions): string {
408408 return safeSize ( options . bodyFontSize , defaultBodyFontSize ) ;
409409}
410410
411+ function proseLabelFont ( options : DcExportOptions , lineHeight ?: number ) : string {
412+ const family = safeProseFontFamily ( options . bodyFontFamily ) . split ( "," ) [ 0 ] ?? "Pretendard" ;
413+ return lineHeight ? `700 12px/${ lineHeight } ${ family } ` : `700 12px ${ family } ` ;
414+ }
415+
411416function safeCodeFontSize ( options : DcExportOptions ) : string {
412417 return safeSize ( options . codeFontSize , defaultCodeFontSize ) ;
413418}
@@ -1002,9 +1007,7 @@ async function renderCallout(
10021007 display : "block" ,
10031008 margin : "0 0 6px" ,
10041009 color : palette . text ,
1005- "font-family" : safeProseFontFamily ( options . bodyFontFamily ) ,
1006- "font-size" : "12px" ,
1007- "font-weight" : 700 ,
1010+ font : proseLabelFont ( options ) ,
10081011 "letter-spacing" : "0" ,
10091012 } ) ;
10101013 const body = await Promise . all (
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
1010import { parseMarkdownToDocument } from "../../src/lib/editor/markdown-import" ;
1111
1212const expectedDefaultDcProseFontFamily = safeDcProseFontFamily ( defaultProseFontFamily ) ;
13+ const expectedDefaultDcProseLabelFontFamily =
14+ expectedDefaultDcProseFontFamily . split ( "," ) [ 0 ] ?? "Pretendard" ;
1315
1416const exportOptions = {
1517 theme : "github-dark" ,
@@ -976,7 +978,11 @@ describe("exportDocumentToDcHtml", () => {
976978 expect ( html ) . toContain ( "메모 <중요>" ) ;
977979 expect ( html ) . toContain ( "cin/cout 설정을 앞에 둔다." ) ;
978980 expect ( html ) . toMatch (
979- / < s p a n s t y l e = " d i s p l a y : b l o c k ; m a r g i n : 0 0 6 p x ; c o l o r : # [ 0 - 9 a - f ] { 6 } ; f o n t - s i z e : 1 2 p x ; f o n t - w e i g h t : 7 0 0 ; l e t t e r - s p a c i n g : 0 " > 메 모 & l t ; 중 요 & g t ; < \/ s p a n > / ,
981+ new RegExp (
982+ `<span style="display:block;margin:0 0 6px;color:#[0-9a-f]{6};font:700 12px ${ escapeRegExp (
983+ expectedDefaultDcProseLabelFontFamily ,
984+ ) } ;letter-spacing:0">메모 <중요></span>`,
985+ ) ,
980986 ) ;
981987 expect ( html ) . not . toContain ( ">TIP</span>" ) ;
982988 expect ( html ) . not . toContain ( ">핵심 요약</td>" ) ;
You can’t perform that action at this time.
0 commit comments