@diplodoc/transform 4.26.0 → 4.27.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/print.css.map +2 -2
- package/dist/css/yfm.css.map +2 -2
- package/dist/css/yfm.min.css.map +2 -2
- package/dist/js/yfm.js +83 -60
- package/dist/js/yfm.js.map +3 -3
- package/dist/js/yfm.min.js +1 -1
- package/dist/js/yfm.min.js.map +3 -3
- package/lib/md.js +4 -3
- package/lib/md.js.map +1 -1
- package/lib/plugins/links/index.d.ts +2 -1
- package/lib/plugins/links/index.js +13 -5
- package/lib/plugins/links/index.js.map +1 -1
- package/lib/plugins/typings.d.ts +2 -1
- package/lib/sanitize.js +1 -1
- package/lib/sanitize.js.map +1 -1
- package/lib/typings.d.ts +5 -0
- package/package.json +4 -4
- package/src/transform/md.ts +5 -3
- package/src/transform/plugins/links/index.ts +17 -6
- package/src/transform/plugins/typings.ts +2 -1
- package/src/transform/sanitize.ts +2 -2
- package/src/transform/typings.ts +7 -0
|
@@ -485,7 +485,7 @@ const defaultCssWhitelist = {
|
|
|
485
485
|
'--method': true,
|
|
486
486
|
};
|
|
487
487
|
|
|
488
|
-
const yfmHtmlAttrs = ['note-type', '
|
|
488
|
+
const yfmHtmlAttrs = ['note-type', 'term-key'];
|
|
489
489
|
|
|
490
490
|
const allowedTags = Array.from(
|
|
491
491
|
new Set([...htmlTags, ...svgTags, ...sanitizeHtml.defaults.allowedTags]),
|
|
@@ -518,7 +518,7 @@ export const defaultOptions: SanitizeOptions = {
|
|
|
518
518
|
function sanitizeStyleTags(dom: cheerio.CheerioAPI, cssWhiteList: CssWhiteList) {
|
|
519
519
|
const styleTags = dom('style');
|
|
520
520
|
|
|
521
|
-
styleTags.each((_index
|
|
521
|
+
styleTags.each((_index, element) => {
|
|
522
522
|
const styleText = dom(element).text();
|
|
523
523
|
|
|
524
524
|
try {
|
package/src/transform/typings.ts
CHANGED
|
@@ -10,10 +10,16 @@ export interface MarkdownIt extends DefaultMarkdownIt {
|
|
|
10
10
|
assets?: string[];
|
|
11
11
|
meta?: string[];
|
|
12
12
|
}
|
|
13
|
+
|
|
13
14
|
export interface StateCore extends DefaultStateCore {
|
|
14
15
|
md: MarkdownIt;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
export interface CacheContext {
|
|
19
|
+
get(key: string): string | null | undefined;
|
|
20
|
+
set(key: string, value: string | null | undefined): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
export type HighlightLangMap = Record<string, LanguageFn>;
|
|
18
24
|
|
|
19
25
|
export type Heading = {
|
|
@@ -49,6 +55,7 @@ export interface OptionsType {
|
|
|
49
55
|
transformLink?: (href: string) => string;
|
|
50
56
|
getPublicPath?: (options: OptionsType, href?: string) => string;
|
|
51
57
|
renderInline?: boolean;
|
|
58
|
+
cache?: CacheContext;
|
|
52
59
|
[x: string]: unknown;
|
|
53
60
|
}
|
|
54
61
|
|