dogancelik / irccloud-sws

✏️ Enables text styles in IRCCloud
MIT License
21 stars 6 forks source link

Send With Style corrupts links with certain non ascii characters. #4

Closed theholyduck closed 9 years ago

theholyduck commented 9 years ago

If you try to link a webpage that uses non ascii characters that are replaced with a %C# it will break the link and color the bits after it.

is there some way of making the control code used to initiate this configurable. so i dont have to keep turning the feature on and off?

example link that you cant send while the script is enabled.

https://en.wikipedia.org/wiki/Kar%C5%8Dshi

dogancelik commented 9 years ago

Things I can think of:

  1. Allow change of key % to something else
  2. Add something like (back tick)your link(back tick) that so it will not parse anything inside ` (back tick)
  3. Find a way to detect links so it won't parse the links.

In 1st way, let's say user changed it to ^ what if we get a link like this: http://blabla.com/^C5^C4 then it will break again. 2nd way: Users have to type back tick every time they want to add a link. So bothersome IMO. I think the best way is 3rd way because user won't have to do anything. Things will just work as before, no configuration needed.

What do you suggest?

theholyduck commented 9 years ago

i mean, in a perfect world, it wouldnt use any regularly used ascii characters. it would just be a keyboard shortcut like the ctrl+c on irsii or the ctrl+k on hexchat, that just inserts the invisible ascii character. with some sort of visual indication that you just did this.

if this really isnt an option, i think i prefer being able to set my own ascii character for you to parse.

dogancelik commented 9 years ago

I think a keyboard shortcut is possible. I can do this so there will be two options:

  1. Auto replace %C, %B etc. with actual codes.
  2. Use a keyboard shortcut to add codes yourself.

But first I need to make sure IRCCloud is not using Ctrl+C or Ctrl+K etc.

Edit: Working on keyboard shortcuts, it might take 1 week.

Eeems commented 9 years ago

Err... IRCCloud might not be using Ctrl-C, but the OS does for copying on Windows and Linux. Might not be the best idea to use that one.

theholyduck commented 9 years ago

and irccloud does use ctrl+k. irssi does use ctrl+c on linux and windows, but its in a terminal so it uses a different way of copy and pasting anyway. im not entirely sure what another viable keyboard shortcut would be

Eeems commented 9 years ago

Ctrl-shift-c/k is a possibility.

dogancelik commented 9 years ago

Firebug uses Ctrl+Shift+C, Ctrl+Shift+K opens "Jump to channel" dialog (IRCCloud bug) Almost everything Ctrl+Shift+? used by some add-on in my Firefox, but I managed to find Ctrl+Shift+Z to be empty.

Implementation is complete. Here's how it works: You press Ctrl+Shift+Z (we will change this based on consensus) then press a Style key (C for Color, B for Bold) etc.

Textbox turns blue to indicate it is waiting for a Style key.

In this example GIF, I press Ctrl+Shift+Z then C (for color) helloworld

Eeems commented 9 years ago

You may want to make the key input configurable. That way users can use whatever works best for their setup.

dogancelik commented 9 years ago

Yes I am going to do that actually :)

Eeems commented 9 years ago

It might be better to switch this to have the keyboard shortcut insert %C %B etc. That way there is visible input on all browsers.

dogancelik commented 9 years ago

Yeah I can do that (a visual for inserted characters) with some sort of hack but why work?