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.
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.
Better half-markdown.
This fixes some issues with the current semi-markdown-parser to make life easier until a full markdown parser is implemented.
Changes:
- A * that would normally start italics but isn't matched by a closing *, is now left alone.
- A ` that would normally start a code block but isn't matched by a closing `, is now left alone.
- Backslashes should work as expected.
- Support for **bold** and the alternative _italic_ style.