From 01b96203da70f98be828451506576899a56ba22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl-Ian?= Date: Sun, 19 May 2024 13:10:02 +0200 Subject: [PATCH] Update documentation --- npm/README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/npm/README.md b/npm/README.md index ed67e8c..980cd82 100644 --- a/npm/README.md +++ b/npm/README.md @@ -211,11 +211,15 @@ New items need to have a bunch of attributes updated before insert to make their ```javascript import Cocooned from '@notus.sh/cocooned' -// These 4 replacements are already set by default. -Cocooned.registerReplacement('name', '[', ']') -Cocooned.registerReplacement('id', '_') // Same start and end? Don't repeat yourself -Cocooned.registerReplacement('for', '_') -Cocooned.registerReplacement('input', '_') // Trix compatibility. +/** + * These 4 replacements are already set by default. + */ +Cocooned.registerReplacement({ attribute: 'name', delimiters: ['[', ']'] }) +// Same start and end? Don't repeat yourself. +Cocooned.registerReplacement({ attribute: 'id', delimiters: ['_'] }) +// You can target specific tags (else '*' is implied). +Cocooned.registerReplacement({ tag: 'label', attribute: 'for', delimiters: ['_'] }) +Cocooned.registerReplacement({ tag: 'trix-editor', attribute: 'input', delimiters: ['_'] }) ``` ## Migration from a previous version