Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
6d5c1c40e1
commit
a4432f126c
@@ -122,7 +122,28 @@ const PaddedParagraph = Paragraph.extend({
|
||||
},
|
||||
});
|
||||
|
||||
const FONT_FAMILIES = [
|
||||
// Heading with same indent attribute so indent works on H1-H3 too
|
||||
const PaddedHeading = Heading.extend({
|
||||
addAttributes() {
|
||||
return {
|
||||
...this.parent?.(),
|
||||
indent: {
|
||||
default: 0,
|
||||
parseHTML: (el) => {
|
||||
const pl = (el as HTMLElement).style.paddingLeft;
|
||||
if (!pl) return 0;
|
||||
const n = parseInt(pl, 10);
|
||||
return isNaN(n) ? 0 : n;
|
||||
},
|
||||
renderHTML: (attrs) => {
|
||||
const i = Number(attrs.indent ?? 0);
|
||||
if (!i) return {};
|
||||
return { style: `padding-left: ${i}px` };
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
{ value: "Bookman Old Style", label: "Bookman Old Style", pdf: "times" },
|
||||
{ value: "Times New Roman", label: "Times New Roman", pdf: "times" },
|
||||
{ value: "Georgia", label: "Georgia", pdf: "times" },
|
||||
|
||||
Reference in New Issue
Block a user