markdown-text-editor 2.0.0-beta.2 → 2.0.0-beta.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": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.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
@@ -238,6 +238,16 @@ export declare class Tool {
238
238
  createButton(iconHtml?: string): HTMLElement | null;
239
239
  /** Called when the button is clicked, or its shortcut is pressed. */
240
240
  applySyntax(event?: Event): void;
241
+ /**
242
+ * Shrinks the selection so it holds no leading or trailing whitespace.
243
+ * Call it first in `applySyntax` if your tool wraps the selection inline,
244
+ * since double-clicking a word selects the space after it and the closing
245
+ * marker would otherwise land on the wrong side of it.
246
+ *
247
+ * Line based tools should not call it: a trailing newline is what tells
248
+ * them which lines the selection covers.
249
+ */
250
+ trimSelection(): void;
241
251
  /** Set to e.g. `'Ctrl+Shift+K'` to bind a shortcut. */
242
252
  shortcut?: string;
243
253
  /** Implement to release anything the tool registered. Called by `destroy()`. */