mirror of
https://github.com/codex-team/editor.js
synced 2024-05-20 15:26:48 +02:00
bcdfcdadbc
* Move all modules to ts * It works * Update README.md Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com> * Interfaces * Interfaces * Move depending interfaces to external types * Update README.md * update tools * add some docs * Add some fixes * Add desctiprion for Block declaration and Core properties * Fixes due comments : * Remove Block from external types * Bump version * Update src/components/modules/tools.ts Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com> * Update src/components/core.ts Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com> * Rename gteBlockHTMLByIndex to getBlockByIndex * Remove unnecessary constructors * Clean up bindEvents method * Add InlineToolConstructable interface * Delete legacy notifications class * Fix zero-configuration bugs * Update inline tools and block tunes constructors
36 lines
931 B
TypeScript
36 lines
931 B
TypeScript
export interface SanitizerConfig {
|
|
/**
|
|
* Tag name and params not to be stripped off
|
|
* @see {@link https://github.com/guardian/html-janitor}
|
|
*
|
|
* @example Save P tags
|
|
* p: true
|
|
*
|
|
* @example Save A tags and do not strip HREF attribute
|
|
* a: {
|
|
* href: true
|
|
* }
|
|
*
|
|
* @example Save A tags with TARGET="_blank" attribute
|
|
* a: function (aTag) {
|
|
* return aTag.target === '_black';
|
|
* }
|
|
*
|
|
* @example Save U tags that are not empty
|
|
* u: function(el){
|
|
* return el.textContent !== '';
|
|
* }
|
|
*
|
|
* @example For blockquote with class 'indent' save CLASS and STYLE attributes
|
|
* Otherwise strip all attributes
|
|
* blockquote: function(el) {
|
|
* if (el.classList.contains('indent')) {
|
|
* return { 'class': true, 'style': true };
|
|
* } else {
|
|
* return {};
|
|
* }
|
|
* }
|
|
*/
|
|
[key: string]: boolean|{[attr: string]: boolean|string}|(() => any);
|
|
}
|