obsidian-smarter-md-hotkeys icon indicating copy to clipboard operation
obsidian-smarter-md-hotkeys copied to clipboard

[Bug]: Special case with special character at the end

Open dummifiedme opened this issue 2 years ago • 3 comments

Bug Description

In situations with a sentence that starts with a normal alphabet but ends with a special character, the plugin excludes the last character.

eg. Part to be highlighted: World Health Organisation (WHO)

Currently it would work like: ==WOrld Health Organisation (WHO==)

It should rather be ==World Health Organisation (WHO)==

If the part to be highlighted was (WHO), then it would make sense to have (==WHO==)

Relevant Screenshot

No response

To Reproduce

No response

Obsidian Version

0.14.6

Which editor are you using?

  • [X] New Editor
  • [ ] Legacy Editor

In which mode(s) does the problem occur?

  • [X] Source (Edit)
  • [X] Live Preview

Checklist

  • [X] I updated to the latest version of the plugin.

dummifiedme avatar Jun 03 '22 08:06 dummifiedme

I've noticed this too. I noticed it with Smarter Comments %% where the final %% are put before the final special characters.

E.g. if you have a word in **bold**, and then want to comment out that word, it becomes %% **bold* %%*.

This happens if you've highlight the whole word, not just had the cursor inside that word. If you have the cursor in the word, i.e. using the Smarter plugin for that, it becomes **%% bold %%**.

This is fine if the whole passage you want to change uses that specific formatting. But if the beginning is plain text, and then the special formatting starts somewhere in the middle the issue that @dummifiedme mentioned appears. And then you have trailing asterisks or equals-signs which do appear floating in the text.

Thanks :)

ReaderGuy42 avatar Jul 01 '22 11:07 ReaderGuy42

Similar issue with links -- if you select The Foo of "Bar" and turn it into a hyperlink, you end up with The Foo of "Bar linked, with the final quote mark outside the link.

pjeby avatar Jul 30 '22 05:07 pjeby

Yup, this is still occurring.

ReaderGuy42 avatar Jul 30 '22 15:07 ReaderGuy42