-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add
allowed
option for inline/block attributes (#115)
The `allowed` option accepts a list of allowed attribute names. If not ``None``, any attributes not in this list will be removed and placed in the token's meta under the key `"insecure_attrs"`. Co-authored-by: maximkurbatov <[email protected]> Co-authored-by: Chris Sewell <[email protected]>
- Loading branch information
1 parent
3f7fcc6
commit 10d5b4d
Showing
3 changed files
with
213 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
- attrs: | ||
- - safe | ||
- d | ||
block: true | ||
children: null | ||
content: '' | ||
hidden: false | ||
info: '' | ||
level: 0 | ||
map: | ||
- 3 | ||
- 4 | ||
markup: '#' | ||
meta: | ||
insecure_attrs: | ||
danger1: a | ||
danger2: c | ||
nesting: 1 | ||
tag: h1 | ||
type: heading_open | ||
- attrs: null | ||
block: true | ||
children: | ||
- attrs: null | ||
block: false | ||
children: null | ||
content: header | ||
hidden: false | ||
info: '' | ||
level: 0 | ||
map: null | ||
markup: '' | ||
meta: {} | ||
nesting: 0 | ||
tag: '' | ||
type: text | ||
content: header | ||
hidden: false | ||
info: '' | ||
level: 1 | ||
map: | ||
- 3 | ||
- 4 | ||
markup: '' | ||
meta: {} | ||
nesting: 0 | ||
tag: '' | ||
type: inline | ||
- attrs: null | ||
block: true | ||
children: null | ||
content: '' | ||
hidden: false | ||
info: '' | ||
level: 0 | ||
map: null | ||
markup: '#' | ||
meta: {} | ||
nesting: -1 | ||
tag: h1 | ||
type: heading_close | ||
- attrs: null | ||
block: true | ||
children: null | ||
content: '' | ||
hidden: false | ||
info: '' | ||
level: 0 | ||
map: | ||
- 5 | ||
- 6 | ||
markup: '' | ||
meta: {} | ||
nesting: 1 | ||
tag: p | ||
type: paragraph_open | ||
- attrs: null | ||
block: true | ||
children: | ||
- attrs: | ||
- - safe | ||
- a | ||
block: false | ||
children: null | ||
content: inline | ||
hidden: false | ||
info: '' | ||
level: 0 | ||
map: null | ||
markup: '`' | ||
meta: | ||
insecure_attrs: | ||
danger: b | ||
nesting: 0 | ||
tag: code | ||
type: code_inline | ||
content: '`inline`{safe=a danger=b}' | ||
hidden: false | ||
info: '' | ||
level: 1 | ||
map: | ||
- 5 | ||
- 6 | ||
markup: '' | ||
meta: {} | ||
nesting: 0 | ||
tag: '' | ||
type: inline | ||
- attrs: null | ||
block: true | ||
children: null | ||
content: '' | ||
hidden: false | ||
info: '' | ||
level: 0 | ||
map: null | ||
markup: '' | ||
meta: {} | ||
nesting: -1 | ||
tag: p | ||
type: paragraph_close |