Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cmd): add need-to-sanitize-html flag #588

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/cmd/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
type: 'boolean',
group: 'Build options:',
})
.option('need-to-sanitize-html', {
default: true,
describe: 'Enable sanitize html',
type: 'boolean',
group: 'Build options:',
})
.check(argvValidator)
.example('yfm -i ./input -o ./output', '')
.demandOption(
Expand All @@ -174,7 +180,7 @@
);
}

async function handler(args: Arguments<any>) {

Check warning on line 183 in src/cmd/build/index.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected any. Specify a different type
const userOutputFolder = resolve(args.output);
const tmpInputFolder = resolve(args.output, TMP_INPUT_FOLDER);
const tmpOutputFolder = resolve(args.output, TMP_OUTPUT_FOLDER);
Expand All @@ -186,7 +192,7 @@
input: tmpInputFolder,
output: tmpOutputFolder,
});
Includers.init([OpenapiIncluder as any]);

Check warning on line 195 in src/cmd/build/index.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected any. Specify a different type

const {
output: outputFolderPath,
Expand Down
1 change: 1 addition & 0 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ interface YfmConfig {
resources?: Resources;
yandexCloudTranslateFolderId: string;
yandexCloudTranslateGlossaryPairs: YandexCloudTranslateGlossaryPair[];
needToSanitizeHtml: boolean;
}

export interface YfmArgv extends YfmConfig {
Expand Down
Loading