QTodoTxt2 icon indicating copy to clipboard operation
QTodoTxt2 copied to clipboard

Link usability issue

Open sttrebo opened this issue 7 years ago • 4 comments

I filed this a while ago for QTodoTxt (not QTodoTxt2). Link to file #413

When you link a file, if that file has spaces in the name then the link doesn't work. The workaround was to manually replace the spaces with %20. Works ok as a workaround. Any chance on getting QTodoTxt2 to automatically change the spaces to %20?

thanks

sttrebo avatar Oct 10 '17 00:10 sttrebo

In fact you wrote the solution in that comment. We need to fill spaces with ^%20. That should be easy... Either using a qt or Python lib or by hand. Maybe you can try? I guess it is a one liner

oroulet avatar Oct 11 '17 06:10 oroulet

not familiar with python, but if I was doing this in AutoHotKey, I would use this: repl .= "%20" IfInString, selectedfile, %A_Space% { StringReplace, newlink, link, %A_Space%, %repl%, All }

I found this python string replace: s = s.replace(' ', '-')

that's about the limit of my python skills unfortunately.

sttrebo avatar Oct 11 '17 14:10 sttrebo

in fact it was not python but javascript. I could not find an official way so I just used replace. You can try: https://github.com/QTodoTxt/QTodoTxt2/commit/e0b51c3be742420d9ebee4141c8bcadb71088d74

oroulet avatar Oct 11 '17 17:10 oroulet

that worked, thanks.

sttrebo avatar Oct 11 '17 17:10 sttrebo