markdown-text-editor 1.9.2 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-text-editor",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "type": "module",
5
5
  "description": "A markdown editor that enhances your textarea instead of replacing it, so form submission, validation and required fields keep working. WYSIWYG hybrid mode, live preview, find and replace, RTL, TypeScript types. Works with any backend.",
6
6
  "funding": "https://ko-fi.com/nezanuha",
package/types/index.d.ts CHANGED
@@ -208,6 +208,16 @@ export declare class Tool {
208
208
  createButton(iconHtml?: string): HTMLElement | null;
209
209
  /** Called when the button is clicked, or its shortcut is pressed. */
210
210
  applySyntax(event?: Event): void;
211
+ /**
212
+ * Shrinks the selection so it holds no leading or trailing whitespace.
213
+ * Call it first in `applySyntax` if your tool wraps the selection inline,
214
+ * since double-clicking a word selects the space after it and the closing
215
+ * marker would otherwise land on the wrong side of it.
216
+ *
217
+ * Line based tools should not call it: a trailing newline is what tells
218
+ * them which lines the selection covers.
219
+ */
220
+ trimSelection(): void;
211
221
  /** Set to e.g. `'Ctrl+Shift+K'` to bind a shortcut. */
212
222
  shortcut?: string;
213
223
  /** Implement to release anything the tool registered. Called by `destroy()`. */