Skip to content

Commit

Permalink
chore: Fix missed types for cheerio pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 16, 2024
1 parent 3ce51f7 commit c81ad73
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 12 deletions.
115 changes: 106 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"dependencies": {
"@diplodoc/tabs-extension": "^3.2.0",
"chalk": "^4.1.2",
"cheerio": "^1.0.0-rc.12",
"cheerio": "^1.0.0",
"css": "^3.0.0",
"cssfilter": "0.0.10",
"get-root-node-polyfill": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/transform/sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ const defaultCssWhitelist = {
'--method': true,
};

const yfmHtmlAttrs = ['note-type', 'yfm2xliff-explicit', 'term-key'];
const yfmHtmlAttrs = ['note-type', 'term-key'];

const allowedTags = Array.from(
new Set([...htmlTags, ...svgTags, ...sanitizeHtml.defaults.allowedTags]),
Expand Down Expand Up @@ -518,7 +518,7 @@ export const defaultOptions: SanitizeOptions = {
function sanitizeStyleTags(dom: cheerio.CheerioAPI, cssWhiteList: CssWhiteList) {
const styleTags = dom('style');

styleTags.each((_index: number, element: cheerio.Element) => {
styleTags.each((_index, element) => {
const styleText = dom(element).text();

try {
Expand Down

0 comments on commit c81ad73

Please sign in to comment.