From d2d85ee20d0c400e75dd6cffbb072bfb71644f3e Mon Sep 17 00:00:00 2001 From: Murod Khaydarov Date: Thu, 4 Jan 2018 23:45:37 +0300 Subject: [PATCH 1/2] Sanitizer docs --- docs/caret.md | 4 +--- docs/sanitizer.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 docs/sanitizer.md diff --git a/docs/caret.md b/docs/caret.md index b03dd5a9..dd68e53f 100644 --- a/docs/caret.md +++ b/docs/caret.md @@ -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 diff --git a/docs/sanitizer.md b/docs/sanitizer.md new file mode 100644 index 00000000..bb3e88f4 --- /dev/null +++ b/docs/sanitizer.md @@ -0,0 +1,45 @@ +# CodeX Editor Sanitizer Module + +The `Sanitizer` module represents a set via methods that clears taint string. +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)| + From be575a19f34e654e8e048ff5d46906eba04063d6 Mon Sep 17 00:00:00 2001 From: Murod Khaydarov Date: Fri, 5 Jan 2018 18:52:57 +0300 Subject: [PATCH 2/2] up docs --- docs/sanitizer.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sanitizer.md b/docs/sanitizer.md index bb3e88f4..31081ac3 100644 --- a/docs/sanitizer.md +++ b/docs/sanitizer.md @@ -1,6 +1,6 @@ # CodeX Editor Sanitizer Module -The `Sanitizer` module represents a set via methods that clears taint string. +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 @@ -10,18 +10,18 @@ You can read more about Module class [here]() ## Properties -Default Editor sanitizer configuration according to the html-janitor API +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 +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 +Property that holds an instance used in Module ```javascript sanitizerInstance ```