I've encountered a problem when trying to use a passphrase with spaces in `/olm import`.
The arguments were just broken by spaces. shlex has more advanced splitting which allows
taking multi-word arguments in quotes.
Calling ``matrix_upload.py --encrypt`` with a filename outside of the
current directory fails due to a typo in EncryptedUpload which uses the
basename of the file instead of the original/full path.
This indexing (i.e. __getitem__) introduced in Python 3.5 as an alias of
the group method, so using it breaks this plugin on older Python
versions. In particular, messages containing urls cannot be sent and
result in an exception:
File "matrix/colors.py", line 106, in <lambda>
lambda m: "a" * len(m[0]),
TypeError: '_sre.SRE_Match' object has no attribute '__getitem__'
This commit replaces the use of the index operation / __getitem__ with
the group method, which is equivalent but supported on all python
versions.
Add a second (optional) positional argument to specify the destination
file. If a file has been specified, just save without running the
default plumber.
Specifying a custom plumber allows to both save and run the plumber.
Previously, the behaviour was inconsistent; if there was no other
formatting, weechat-matrix doesn't send formatted_body, and Riot would
display the message as-is. If there _was_ other formatting,
formatted_body is sent without escaping of the HTML characters, so that
Riot would interpret them as HTML.
This makes both cases consistent, using the first behaviour.
Backslashes are now correctly preserved inside code blocks while still allowing the user to escape a backtick. The handling of backticks and bold/italic wrappers was unified so that they share the same escaping code.
Backslashes only escape Markdown wrapper characters (*, _, `). If they are encountered before another character, they are considered literal.