dwaring87 / rtm-cli

Remember the Milk Command Line Interface
MIT License
66 stars 14 forks source link

URLs in smart add get mangled by parser #12

Closed SchmolleGit closed 5 years ago

SchmolleGit commented 5 years ago

URLs get parsed by Smart Add by not having any particular marking and being outside of the 'title' bit at the front and being recognisable as a URL (http[s]-->first space). If I include URLs, what happens is that (a) the : and // are interpreted as special characters.

But even when they are escaped, rtm-cli seems to stick the URL to last previous argument (typically a tag). I speculate it is because the parser is searching for a limited set of special characters and thus discards the space and adds the whole URL to the tag that came before it.

A proper fix would be to scan for http[s] and treat it properly (by not doing anything to it and acknowledging that the previous argument is complete). Given the escaping issues, it may be useful to add a u:{http://domain.something.com} syntax.