Skip to content

Commit fdfeb76

Browse files
committed
update no-v-html
1 parent 3b23e23 commit fdfeb76

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

docs/rules/no-v-html.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,29 @@ This rule reports use of `v-html` directive in order to reduce the risk of injec
88

99
This rule reports all uses of `v-html` to help prevent XSS attacks.
1010

11-
This rule does not check syntax errors in directives because it's checked by no-parsing-error rule.
12-
13-
:-1: Examples of **incorrect** code for this rule:
14-
15-
```html
16-
<template>
17-
<div v-html="someHTML"></div>
18-
</template>
11+
<eslint-code-block :rules="{'vue/no-v-html': ['error']}">
1912
```
20-
21-
:+1: Examples of **correct** code for this rule:
22-
23-
```html
2413
<template>
25-
<div>{{someHTML}}</div>
14+
<!-- ✓ GOOD -->
15+
<div>{{ someHTML }}</div>
16+
17+
<!-- ✗ BAD -->
18+
<div v-html="someHTML"></div>
2619
</template>
2720
```
21+
</eslint-code-block>
22+
23+
This rule does not check syntax errors in directives because it's checked by no-parsing-error rule.
2824

2925
## :wrench: Options
3026

3127
Nothing.
3228

33-
## When Not To Use It
29+
## :mute: When Not To Use It
3430

3531
If you are certain the content passed `to v-html` is sanitized HTML you can disable this rule.
3632

37-
## Related links
33+
## :books: Further reading
3834

3935
- [XSS in Vue.js](https://blog.sqreen.io/xss-in-vue-js/)
4036

0 commit comments

Comments
 (0)