Skip to content

Commit fc63a9f

Browse files
committed
[SECURITY FIX] CWE-1333: Inefficient Regular Expression Complexity #13
Update dependencies. Update MarkdownDemo and LinterAndCrossBindingDemo.
1 parent 3f97d6b commit fc63a9f

File tree

5 files changed

+367
-221
lines changed

5 files changed

+367
-221
lines changed

package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "vue-codemirror6",
4-
"version": "1.1.10",
4+
"version": "1.1.11",
55
"license": "MIT",
66
"description": "CodeMirror6 Component for vue2 and vue3.",
77
"keywords": [
@@ -88,17 +88,17 @@
8888
}
8989
},
9090
"devDependencies": {
91-
"@codemirror/lang-javascript": "^6.1.2",
91+
"@codemirror/lang-javascript": "^6.1.3",
9292
"@codemirror/lang-json": "^6.0.1",
9393
"@codemirror/lang-markdown": "^6.0.5",
9494
"@types/lodash": "^4.14.191",
9595
"@types/node": "^18.11.18",
96-
"@typescript-eslint/eslint-plugin": "^5.49.0",
97-
"@typescript-eslint/parser": "^5.49.0",
96+
"@typescript-eslint/eslint-plugin": "^5.50.0",
97+
"@typescript-eslint/parser": "^5.50.0",
9898
"@vitejs/plugin-vue": "^4.0.0",
9999
"@vue/eslint-config-prettier": "^7.0.0",
100100
"@vue/tsconfig": "^0.1.3",
101-
"@vueuse/core": "^9.11.1",
101+
"@vueuse/core": "^9.12.0",
102102
"eslint": "^8.33.0",
103103
"eslint-config-google": "^0.14.0",
104104
"eslint-config-prettier": "^8.6.0",
@@ -107,7 +107,7 @@
107107
"eslint-linter-browserify": "^8.33.0",
108108
"eslint-plugin-html": "^7.1.0",
109109
"eslint-plugin-import": "^2.27.5",
110-
"eslint-plugin-jsdoc": "^39.7.0",
110+
"eslint-plugin-jsdoc": "^39.8.0",
111111
"eslint-plugin-prettier": "^4.2.1",
112112
"eslint-plugin-tsdoc": "^0.2.17",
113113
"eslint-plugin-vue": "^9.9.0",
@@ -119,13 +119,15 @@
119119
"prettier": "^2.8.3",
120120
"rimraf": "^4.1.2",
121121
"rollup-plugin-visualizer": "^5.9.0",
122-
"typescript": "^4.9.4",
123-
"vite": "^4.0.4",
122+
"sass": "^1.58.0",
123+
"sass-loader": "^13.2.0",
124+
"typescript": "^4.9.5",
125+
"vite": "^4.1.1",
124126
"vite-plugin-banner": "^0.7.0",
125127
"vite-plugin-checker": "^0.5.5",
126-
"vue": "^3.2.45",
128+
"vue": "3.2.45",
127129
"vue-eslint-parser": "^9.1.0",
128-
"vue-markdown-wasm": "^0.3.1",
130+
"vue-markdown-wasm": "^0.3.2",
129131
"vue-tsc": "^1.0.24"
130132
},
131133
"husky": {
@@ -138,6 +140,7 @@
138140
"*": "prettier -w -u"
139141
},
140142
"resolutions": {
141-
"json5": "^2.2.3"
143+
"json5": "^2.2.3",
144+
"http-cache-semantics": "^4.1.1"
142145
}
143146
}

src-docs/DemoPage.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ const linterAndCrossBindingDemoSrc = LinterAndCrossBindingDemoSrc.trim();
7878
In this sample, the text is put directly inside the
7979
<code>&lt;code-mirror&gt;</code>
8080
tag to make it the initial string. On the Vue side, it is evaluated as a
81-
DOM node and only the text node is used as the value.
81+
DOM node and only the text node is used as the value. In addition, it
82+
does not work with Vue2.7.
8283
</p>
8384
<p>
8485
It's just for simple syntax highlighting. Do not use with

src-docs/components/LinterAndCrossBindingDemo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ const onUpdate = update => {
4848
</script>
4949

5050
<template>
51-
<!-- eslint-disable vuejs-accessibility/form-control-has-label -->
52-
<!-- eslint-disable vuejs-accessibility/label-has-for -->
5351
<div class="row">
5452
<div class="col-6 mb-3">
5553
<code-mirror
@@ -64,9 +62,11 @@ const onUpdate = update => {
6462
/>
6563
</div>
6664
<div class="col-6 mb-3">
67-
<textarea v-model="value" rows="4" class="form-control" />
65+
<!-- eslint-disable-next-line vuejs-accessibility/form-control-has-label, vue/html-self-closing -->
66+
<textarea v-model="value" rows="4" class="form-control"></textarea>
6867
</div>
6968
<div class="col-12 mb-3">
69+
<!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->
7070
<label for="count" class="visually-hidden">Linter Error Count</label>
7171
<div class="input-group">
7272
<div class="input-group-text">Linter Error Count</div>

src-docs/components/MarkdownDemo.vue

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,61 @@ defineProps({ dark: Boolean });
3030
/>
3131
</div>
3232
<div class="col-6">
33-
<vue-markdown v-model="input" />
33+
<vue-markdown v-model="input" class="markdown-body" />
3434
</div>
3535
</div>
3636
</template>
37+
38+
<style lang="scss">
39+
@import url(https://cdn.jsdelivr.net/npm/[email protected]/github-markdown.min.css);
40+
41+
.markdown-body {
42+
h1 > a.anchor,
43+
h2 > a.anchor,
44+
h3 > a.anchor,
45+
h4 > a.anchor,
46+
h5 > a.anchor,
47+
h6 > a.anchor {
48+
display: block;
49+
float: left;
50+
height: 1.2em;
51+
width: 1em;
52+
margin-left: -1em;
53+
position: relative;
54+
outline: none;
55+
}
56+
/*.anchor:target { background: yellow; }*/
57+
h1 > a.anchor:before,
58+
h2 > a.anchor:before,
59+
h3 > a.anchor:before,
60+
h4 > a.anchor:before,
61+
h5 > a.anchor:before,
62+
h6 > a.anchor:before {
63+
visibility: hidden;
64+
position: absolute;
65+
opacity: 0.2;
66+
right: 0;
67+
top: 0;
68+
width: 1.2em;
69+
line-height: inherit;
70+
content: '🔗';
71+
}
72+
h1 > a.anchor:hover:before,
73+
h2 > a.anchor:hover:before,
74+
h3 > a.anchor:hover:before,
75+
h4 > a.anchor:hover:before,
76+
h5 > a.anchor:hover:before,
77+
h6 > a.anchor:hover:before {
78+
visibility: visible;
79+
opacity: 0.8;
80+
}
81+
h1:hover .anchor:before,
82+
h2:hover .anchor:before,
83+
h3:hover .anchor:before,
84+
h4:hover .anchor:before,
85+
h5:hover .anchor:before,
86+
h6:hover .anchor:before {
87+
visibility: visible;
88+
}
89+
}
90+
</style>

0 commit comments

Comments
 (0)