251210_02_ENH : 이전파일 누락 내용 추가
This commit is contained in:
22
src/components/kri-editor/extensions/font-size.ts
Normal file
22
src/components/kri-editor/extensions/font-size.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Extension } from "@tiptap/core";
|
||||
|
||||
export const FontSize = Extension.create({
|
||||
name: "fontSize",
|
||||
addGlobalAttributes() {
|
||||
return [
|
||||
{
|
||||
types: ["textStyle"],
|
||||
attributes: {
|
||||
fontSize: {
|
||||
default: null as string | null,
|
||||
parseHTML: (element) => (element as HTMLElement).style.fontSize || null,
|
||||
renderHTML: (attributes) => {
|
||||
if (!attributes.fontSize) return {};
|
||||
return { style: `font-size:${attributes.fontSize}` };
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user