mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 15:45:47 +01:00
commit
cbfcecda92
2 changed files with 46 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ The `Caret` module contains methods working with caret. Uses [Range](https://dev
|
|||
between blocks.
|
||||
|
||||
Caret class implements basic Module class that holds User configuration
|
||||
and default CodeXEditor instances
|
||||
and default CodeX Editor instances
|
||||
|
||||
You can read more about Module class [here]()
|
||||
|
||||
|
|
@ -12,14 +12,12 @@ You can read more about Module class [here]()
|
|||
|
||||
## Methods
|
||||
|
||||
|
||||
### setToBlock
|
||||
|
||||
```javascript
|
||||
Caret.setToBlock(block, offset, atEnd)
|
||||
```
|
||||
|
||||
|
||||
> Method gets Block instance and puts caret to the text node with offset
|
||||
|
||||
#### params
|
||||
|
|
|
|||
45
docs/sanitizer.md
Normal file
45
docs/sanitizer.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# CodeX Editor Sanitizer Module
|
||||
|
||||
The `Sanitizer` module represents a set of methods that clears taint strings.
|
||||
Uses lightweight npm package with simple API [html-janitor](https://www.npmjs.com/package/html-janitor)
|
||||
|
||||
Sanitizer class implements basic Module class that holds User configuration
|
||||
and default CodeX Editor instances
|
||||
|
||||
You can read more about Module class [here]()
|
||||
|
||||
## Properties
|
||||
|
||||
Default Editor Sanitizer configuration according to the html-janitor API
|
||||
```javascript
|
||||
defaultConfig
|
||||
```
|
||||
|
||||
Custom User configuration which passed on Editor initialization. Data type must be according to the html-janitor API
|
||||
```javascript
|
||||
sanitizerConfig
|
||||
```
|
||||
|
||||
|
||||
Property that holds an instance used in Module
|
||||
```javascript
|
||||
sanitizerInstance
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
### clean
|
||||
|
||||
```javascript
|
||||
clean(taintString, customConfig)
|
||||
```
|
||||
|
||||
> Cleans up the passed taint string
|
||||
|
||||
#### params
|
||||
|
||||
| Param | Type | Description|
|
||||
| -------------|------ |:-------------:|
|
||||
| taintString | String | string that needs to be cleaned|
|
||||
| customConfig | Object | Can be passed new config per usage (Default: uses default configuration)|
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue