Skip to content

Commit 3aa9433

Browse files
committed
chore: rename params
1 parent 648f539 commit 3aa9433

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/transform/md.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function initCompiler(md: MarkdownIt, options: OptionsType, env: EnvType) {
169169

170170
// Sanitize the page
171171
return needToSanitizeHtml
172-
? sanitizeHtml(html, sanitizeOptions, env.forcedSanitizeCssWhiteList)
172+
? sanitizeHtml(html, sanitizeOptions, {cssWhiteList: env.forcedSanitizeCssWhiteList})
173173
: html;
174174
};
175175
}

src/transform/plugins/imsize/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {ImsizeAttr} from './const';
66
import {parseImageSize} from './helpers';
77

88
export type ImsizeOptions = {
9-
inlineSizeStyling?: boolean;
9+
enableInlineStyling?: boolean;
1010
};
1111

1212
export const imageWithSize = (md: MarkdownIt, opts?: ImsizeOptions): ParserInline.RuleInline => {
@@ -211,7 +211,7 @@ export const imageWithSize = (md: MarkdownIt, opts?: ImsizeOptions): ParserInlin
211211
token.attrs.push([ImsizeAttr.Height, height]);
212212
}
213213

214-
if (opts?.inlineSizeStyling) {
214+
if (opts?.enableInlineStyling) {
215215
let style: string | undefined = '';
216216

217217
const widthWithPercent = width.includes('%');

src/transform/sanitize.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,14 @@ function sanitizeStyles(html: string, options: SanitizeOptions) {
601601
export default function sanitize(
602602
html: string,
603603
options?: SanitizeOptions,
604-
forcedSanitizeCssWhiteList?: CssWhiteList,
604+
additionalOptions?: SanitizeOptions,
605605
) {
606606
const sanitizeOptions = options || defaultOptions;
607607

608-
if (forcedSanitizeCssWhiteList) {
608+
if (additionalOptions?.cssWhiteList) {
609609
sanitizeOptions.cssWhiteList = {
610610
...sanitizeOptions.cssWhiteList,
611-
...forcedSanitizeCssWhiteList,
611+
...additionalOptions.cssWhiteList,
612612
};
613613
}
614614

test/imsize.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('imsize with inlineStyling', () => {
2020
html: true,
2121
linkify: false,
2222
typographer: false,
23-
}).use(imsize, {inlineSizeStyling: true});
23+
}).use(imsize, {enableInlineStyling: true});
2424

2525
generate(path.join(__dirname, 'data/imsize/imsize-inlineSizeStyling-fixtures.txt'), md);
2626
});

0 commit comments

Comments
 (0)