@vuepress/markdown 2.0.0-beta.53 → 2.0.0-beta.55

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/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export { default as emojiPlugin } from 'markdown-it-emoji';
16
16
  export { ComponentPluginOptions, componentPlugin } from '@mdit-vue/plugin-component';
17
17
  export { titlePlugin } from '@mdit-vue/plugin-title';
18
18
 
19
- declare type AnchorPluginOptions = anchorPlugin.AnchorOptions;
19
+ type AnchorPluginOptions = anchorPlugin.AnchorOptions;
20
20
 
21
21
  interface AssetsPluginOptions {
22
22
  /**
@@ -69,7 +69,7 @@ interface CodePluginOptions {
69
69
  */
70
70
  declare const codePlugin: PluginWithOptions<CodePluginOptions>;
71
71
 
72
- declare type EmojiPluginOptions = emojiPlugin.Options;
72
+ type EmojiPluginOptions = emojiPlugin.Options;
73
73
 
74
74
  interface ImportCodePluginOptions {
75
75
  /**
@@ -107,7 +107,7 @@ interface LinksPluginOptions {
107
107
  */
108
108
  declare const linksPlugin: PluginWithOptions<LinksPluginOptions>;
109
109
 
110
- declare type Markdown = MarkdownIt;
110
+ type Markdown = MarkdownIt;
111
111
 
112
112
  interface MarkdownOptions extends MarkdownIt.Options {
113
113
  anchor?: false | AnchorPluginOptions;
@@ -127,7 +127,7 @@ interface MarkdownOptions extends MarkdownIt.Options {
127
127
  /**
128
128
  * Headers in markdown file
129
129
  */
130
- declare type MarkdownHeader = PageHeader;
130
+ type MarkdownHeader = PageHeader;
131
131
  /**
132
132
  * Internal links in markdown file
133
133
  *
@@ -174,7 +174,7 @@ interface MarkdownEnv extends MarkdownItEnv {
174
174
  /**
175
175
  * Type of `slugify` function
176
176
  */
177
- declare type MarkdownSlugifyFunction = (str: string) => string;
177
+ type MarkdownSlugifyFunction = (str: string) => string;
178
178
 
179
179
  /**
180
180
  * Create vuepress customized markdown-it instance
package/dist/index.js CHANGED
@@ -52,15 +52,15 @@ var assetsPlugin = (md, { relativePathPrefix = "@source" } = {}) => {
52
52
  };
53
53
  const createHtmlRule = (rawHtmlRule) => (tokens, idx, options, env, self) => {
54
54
  tokens[idx].content = tokens[idx].content.replace(
55
- /(<img\b.*?src=")([^"]*)(")/gs,
56
- (_, prefix, src, suffix) => `${prefix}${resolveLink(
55
+ /(<img\b.*?src=)(['"])([^\2]*?)\2/gs,
56
+ (_, prefix, quote, src) => `${prefix}${quote}${resolveLink(
57
57
  src.trim(),
58
58
  relativePathPrefix,
59
59
  env
60
- )}${suffix}`
60
+ )}${quote}`
61
61
  ).replace(
62
- /(<img\b.*?srcset=")([^"]*)(")/gs,
63
- (_, prefix, srcset, suffix) => `${prefix}${srcset.split(",").map(
62
+ /(<img\b.*?srcset=)(['"])([^\2]*?)\2/gs,
63
+ (_, prefix, quote, srcset) => `${prefix}${quote}${srcset.split(",").map(
64
64
  (item) => item.trim().replace(
65
65
  /^([^ ]*?)([ \n].*)?$/,
66
66
  (_2, url, descriptor = "") => `${resolveLink(
@@ -69,7 +69,7 @@ var assetsPlugin = (md, { relativePathPrefix = "@source" } = {}) => {
69
69
  env
70
70
  )}${descriptor.replace(/[ \n]+/g, " ").trimEnd()}`
71
71
  )
72
- ).join(", ")}${suffix}`
72
+ ).join(", ")}${quote}`
73
73
  );
74
74
  return rawHtmlRule(tokens, idx, options, env, self);
75
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/markdown",
3
- "version": "2.0.0-beta.53",
3
+ "version": "2.0.0-beta.55",
4
4
  "description": "Markdown package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -37,12 +37,12 @@
37
37
  "@mdit-vue/types": "^0.11.0",
38
38
  "@types/markdown-it": "^12.2.3",
39
39
  "@types/markdown-it-emoji": "^2.0.2",
40
- "@vuepress/shared": "2.0.0-beta.53",
41
- "@vuepress/utils": "2.0.0-beta.53",
42
40
  "markdown-it": "^13.0.1",
43
41
  "markdown-it-anchor": "^8.6.5",
44
42
  "markdown-it-emoji": "^2.0.2",
45
- "mdurl": "^1.0.1"
43
+ "mdurl": "^1.0.1",
44
+ "@vuepress/shared": "2.0.0-beta.55",
45
+ "@vuepress/utils": "2.0.0-beta.55"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/mdurl": "^1.0.2"