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

Allow class attribute through setLink() #2758

Merged
merged 1 commit into from
May 9, 2022
Merged

Commits on May 5, 2022

  1. Allow class attribute through setLink()

    While you can set a default value for the Link extensions class attribute using 
    ```javascript
    Link.configure({
      HTMLAttributes: {
        class: 'my-custom-class',
      },
    })
    ```
    It is currently not possible to dynamically set the class attribute when calling setLink() e.g. 
    ```javascript
    this.editor.chain().focus().extendMarkRange('link').setLink({href: url, class: 'this class should be added'}).run();
    ```
    
    This change allows for that by default, without needing to extend the Link extension.
    Ken-vdE authored May 5, 2022
    Configuration menu
    Copy the full SHA
    352a66c View commit details
    Browse the repository at this point in the history