Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Format on paste #86

Closed
Benature opened this issue Mar 19, 2024 · 1 comment
Closed

[FR] Format on paste #86

Benature opened this issue Mar 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Benature
Copy link
Owner

Benature commented Mar 19, 2024

https://github.com/obsidianmd/obsidian-api/blob/9754fc87dd9a417f198a5cad7f08959206d2f69c/obsidian.d.ts#L4697-L4703

    /**
     * Triggered when the editor receives a paste event.
     * Check for `evt.defaultPrevented` before attempting to handle this event, and return if it has been already handled.
     * Use `evt.preventDefault()` to indicate that you've handled the event.
     * @public
     */
    on(name: 'editor-paste', callback: (evt: ClipboardEvent, editor: Editor, info: MarkdownView | MarkdownFileInfo) => any, ctx?: any): EventRef;
@Benature Benature added the enhancement New feature or request label Mar 19, 2024
Benature added a commit that referenced this issue Mar 19, 2024
@Benature
Copy link
Owner Author

Benature commented Mar 19, 2024

This feature only works on notes that contain metadata tfFormatOnPaste

for example:

---
tfFormatOnPaste: ['lowercase', 'convert-bullet-list', 'easy-typing-format']
---

easy-typing-format called function formatSelectionOrCurLine(editor, view) of Easy Typing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant