vuepress-plugin-md-power 1.0.0-rc.56 → 1.0.0-rc.57

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.
@@ -34,7 +34,7 @@ function highlight() {
34
34
  })
35
35
  if (container) {
36
36
  container.innerHTML = output
37
- .replace(/^<pre[^]+?>/, '')
37
+ .replace(/^<pre[^>]*>/, '')
38
38
  .replace(/<\/pre>$/, '')
39
39
  .replace(/(<span class="line">)(<\/span>)/g, '$1<wbr>$2')
40
40
  }
@@ -3,7 +3,7 @@ import { http } from '../utils/http.js';
3
3
  import { sleep } from '../utils/sleep.js';
4
4
  import { rustExecute } from './rustRepl.js';
5
5
  const ignoredNodes = ['.diff.remove', '.vp-copy-ignore'];
6
- const RE_LANGUAGE = /language-([\w]+)/;
6
+ const RE_LANGUAGE = /language-(\w+)/;
7
7
  const api = {
8
8
  go: 'https://api.pengzhanbo.cn/repl/golang/run',
9
9
  kotlin: 'https://api.pengzhanbo.cn/repl/kotlin/run',
@@ -2,7 +2,7 @@ export function checkIsMobile(ua) {
2
2
  return /\b(?:Android|iPhone)/i.test(ua);
3
3
  }
4
4
  export function checkIsSafari(ua) {
5
- return /version\/([\w.]+) .*(mobile ?safari|safari)/i.test(ua);
5
+ return /version\/[\w.]+ .*(?:mobile ?safari|safari)/i.test(ua);
6
6
  }
7
7
  export function checkIsiPad(ua) {
8
8
  return [
@@ -18,14 +18,19 @@ export function createIconCSSWriter(app, opt) {
18
18
  const cache = new Map();
19
19
  const isInstalled = isPackageExists('@iconify/json');
20
20
  const write = (content) => app.writeTemp('internal/md-power/icons.css', content);
21
+ let timer = null;
21
22
  const options = resolveOption(opt);
22
23
  const prefix = options.prefix;
23
24
  const defaultContent = getDefaultContent(options);
24
25
  async function writeCss() {
25
- let css = defaultContent;
26
- for (const [, { content, className }] of cache)
27
- css += `.${className} {\n --svg: ${content};\n}\n`;
28
- await write(css);
26
+ if (timer)
27
+ clearTimeout(timer);
28
+ timer = setTimeout(async () => {
29
+ let css = defaultContent;
30
+ for (const [, { content, className }] of cache)
31
+ css += `.${className} {\n --svg: ${content};\n}\n`;
32
+ await write(css);
33
+ }, 100);
29
34
  }
30
35
  function addIcon(iconName) {
31
36
  if (!isInstalled)
@@ -1,4 +1,4 @@
1
- const [openTag, endTag] = ['=|', '|='];
1
+ const [openTag, endTag] = ['!!', '!!'];
2
2
  function createTokenizer() {
3
3
  return (state, silent) => {
4
4
  let found = false;
@@ -8,7 +8,7 @@ function createTokenizer() {
8
8
  return false;
9
9
  if (silent)
10
10
  return false;
11
- // =||=
11
+ // - !!!!
12
12
  if (max - start < 5)
13
13
  return false;
14
14
  state.pos = start + 2;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuepress-plugin-md-power",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.56",
4
+ "version": "1.0.0-rc.57",
5
5
  "description": "The Plugin for VuePres 2 - markdown power",
6
6
  "author": "pengzhanbo <volodymyr@foxmail.com>",
7
7
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "peerDependencies": {
34
34
  "@iconify/json": "^2",
35
- "vuepress": "2.0.0-rc.9"
35
+ "vuepress": "2.0.0-rc.12"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@iconify/json": {
@@ -41,18 +41,18 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@iconify/utils": "^2.1.23",
44
- "@vuepress/helper": "2.0.0-rc.28",
44
+ "@vuepress/helper": "2.0.0-rc.31",
45
45
  "@vueuse/core": "^10.9.0",
46
46
  "local-pkg": "^0.5.0",
47
47
  "markdown-it-container": "^4.0.0",
48
48
  "nanoid": "^5.0.7",
49
- "shiki": "^1.5.1",
50
- "tm-grammars": "^1.11.1",
51
- "tm-themes": "^1.4.1",
49
+ "shiki": "^1.6.0",
50
+ "tm-grammars": "^1.12.4",
51
+ "tm-themes": "^1.4.3",
52
52
  "vue": "^3.4.27"
53
53
  },
54
54
  "devDependencies": {
55
- "@iconify/json": "^2.2.208",
55
+ "@iconify/json": "^2.2.214",
56
56
  "@types/markdown-it": "^14.1.1"
57
57
  },
58
58
  "publishConfig": {