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

Adding support for live preview #34

Merged
merged 3 commits into from
Jan 26, 2022
Merged

Conversation

MikhaD
Copy link
Contributor

@MikhaD MikhaD commented Jan 4, 2022

Obsidian live preview required the transition from codemirror 5 to codemirror 6. This meant obsidian had to change their API a bit. In order to get this working with the new API (the main issue was the auto select mode) I had to implement some of the functionality previously provided by code mirror from scratch. Below is a list of the major changes I made.

Changes

  • Replaced the WordBoundries interface in core with EditorRange from the obsidian package

  • Moves isUrl and isImgEmbed out of getReplaceText and into stand alone functions

  • Added documentation for getReplaceText function

  • Added documentation for NothingSelected enum

  • Changed somethingSelected() check at the end of UrlIntoSelection to selectedText === "" because somethingSelected() was returning the wrong value when something was selected

  • Added findWordAt function to mimic the functionality of the codemirror 5 editor.findWordAt function

  • Changed some formatting to make the code a bit more readable

@denolehov denolehov merged commit b37a70a into denolehov:master Jan 26, 2022
@denolehov
Copy link
Owner

Thank you very much! ❤️
I will make a release later today.

@MikhaD
Copy link
Contributor Author

MikhaD commented Jan 26, 2022

Awesome! I wasn't sure whether I should update the package.json version,manifest and change log. I did anyway so that you could potentially release it right away without any changes, but you may want to double check I did it to your standard before making a release.

@denolehov
Copy link
Owner

I use the semantic release to automatically update changelogs and add tags, but it's all good. I will make a release as soon as I have access to my workstation.

Thank you once again for your contribution and sorry for the lack of responsiveness from my side.

@lildude
Copy link

lildude commented Jan 27, 2022

Whoopsie. Merging this without a corresponding release means the plugin is currently uninstallable - #36

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

Successfully merging this pull request may close these issues.

3 participants