sindresorhus/refined-github

Do you want to work on this issue?

You can request for a bounty in order to promote it!

backtick insertion within current selected text, includes trailling whitespaces #4420

staabm posted onGitHub

<!-- Thanks for reporting a bug! ⛰ Make sure the bug is caused by Refined GitHub. Try disabling the extension first. Show us the bug and help us replicate it, include: 1. A REAL URL where the bug appears. If it happens on a private repo, find an equivalent public URL. 2. A screenshot/video/gif of the issue, if it’s visual. 3. Any related errors in the browser’s console, if any. -->

backtick insertion of a current selected text, includes trailling whitespaces, which it shouldn't

repro

  • while editing/creating a issue double click a word
  • the double-clicked word get selected (including the trailling whitespace behind the word)
  • press the backtick-key and refined github will sorround the selected word with backticks (including trailing whitespace)

example:

  • a issue contains the text "the lazy fox jumps over.."
  • double click the word 'lazy'
  • press the backtick-key
  • the resulting markup is "the lazyfox jumps over.." while it should be "the lazy fox jumps over.." (spot the positions of the backticks)

reproduced in firefox 90a1 on windows10x64, with refined github 21.5.19. also reproducible on chrome 93.0.4525.0 on the same machine


  • the double-clicked word get selected (including the trailling whitespace behind the word)

This might be a Windows-specific issue because I don't see it on macOS

  • the backtick-key and refined github will sorround the selected word with backticks (including trailing whitespace)

And this is a bug how? 😃

If you select hello, you're asking the browser to wrap hello, not just hello. Doing otherwise would be wrong, I don't think most editors would try to be "smart" about that.

Here's how it works in my Chrome, including when using the GitHub-native Bold shortcut:

gif

posted by fregante almost 4 years ago

And this is a bug how? 😃

I feel refined github could take this chrome/firefox windows glitches into account and trim the trailing spaces before sorrounding the selection with backticks

Here's how it works in my Chrome, including when using the GitHub-native Bold shortcut:

your recording looks like how I would expect it to work.

posted by staabm almost 4 years ago

If you select hello, you're asking the browser to wrap hello, not just hello. Doing otherwise would be wrong, I don't think most editors would try to be "smart" about that.

I can totally see, that this actually should be considered a browser bug, but I hoped for a fix in refined github, because then the fix would reach the enduser way faster then a browser fix.

maybe its even a windows problem, because it also happens in word etc. (which renders it even less likely to be fixed)

posted by staabm almost 4 years ago

maybe its even a windows problem

Selecting the trailing whitespace appears to be a Windows behavior; Wrapping the exact selection is universal: Not a Refined GitHub problem, not GitHub’s, not Chrome’s, not Windows’.

your recording looks like I would expect it.

I think you're referring to the word selection, because that's the only different part — and Refined GitHub can't change that.

posted by fregante almost 4 years ago

I think you're referring to the word selection, because that's the only different part — and Refined GitHub can't change that.

hm ok, when its not fixable we can close here.

thx for the insights.

posted by staabm almost 4 years ago

You were onto something here! There's an exception: \n

agif

This feature however is handled by https://github.com/fregante/text-field-edit so any changes should be pushed to that repo. It's a little tricky because this changes the selection as well.

posted by fregante almost 4 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests