Skip to content

Commit 049dc29

Browse files
authored
feat(yfmHtmlBlock): updated css white list (#349)
1 parent bd85a1c commit 049dc29

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/extensions/yfm/YfmHtmlBlock/utils.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ describe('sanitize options functions', () => {
8383
order: true,
8484
orphans: true,
8585
'row-gap': true,
86+
all: true,
87+
bottom: true,
88+
content: true,
89+
cursor: true,
90+
direction: true,
91+
left: true,
92+
'line-break': true,
93+
opacity: true,
94+
overflow: true,
95+
'overflow-wrap': true,
96+
'overflow-x': true,
97+
'overflow-y': true,
98+
position: true,
99+
right: true,
100+
top: true,
101+
'white-space': true,
102+
'z-index': true,
86103
});
87104
});
88105
});

src/extensions/yfm/YfmHtmlBlock/utils.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import diplodocSanitize, {SanitizeOptions} from '@diplodoc/transform/lib/sanitiz
44
const getYfmHtmlBlockWhiteList = () => {
55
const whiteList: Record<string, boolean> = {};
66

7+
// flex, grid, column
78
whiteList['align-content'] = true; // default: auto
89
whiteList['align-items'] = true; // default: auto
910
whiteList['align-self'] = true; // default: auto
@@ -50,6 +51,25 @@ const getYfmHtmlBlockWhiteList = () => {
5051
whiteList.orphans = true; // default: 2
5152
whiteList['row-gap'] = true;
5253

54+
// position, opacity, overflow
55+
whiteList['all'] = true; // default: depending on individual properties
56+
whiteList['bottom'] = true; // default: auto
57+
whiteList['content'] = true; // default: normal
58+
whiteList['cursor'] = true; // default: auto
59+
whiteList['direction'] = true; // default: ltr
60+
whiteList['left'] = true; // default: auto
61+
whiteList['line-break'] = true; // default: auto
62+
whiteList['opacity'] = true; // default: 1
63+
whiteList['overflow'] = true; // default: depending on individual properties
64+
whiteList['overflow-wrap'] = true; // default: normal
65+
whiteList['overflow-x'] = true; // default: visible
66+
whiteList['overflow-y'] = true; // default: visible
67+
whiteList['position'] = true; // default: static
68+
whiteList['right'] = true; // default: auto
69+
whiteList['top'] = true; // default: auto
70+
whiteList['white-space'] = true; // default: normal
71+
whiteList['z-index'] = true; // default: auto
72+
5373
return whiteList;
5474
};
5575

0 commit comments

Comments
 (0)