purple-mattermost
purple-mattermost copied to clipboard
html formatting breaks text
Pasting a html formatted text breaks something in pidgin/this plugin...
My clipboard:
<span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:05) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>Bar<br><span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:13) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>bar
Debug log:
(10:36:13) GLib: Source ID 489052 was not found when attempting to remove it
(10:36:15) GLib: g_markup_parse_context_parse: assertion 'context->state != STATE_ERROR' failed
(10:36:15) GLib: g_markup_parse_context_end_parse: assertion 'context->state != STATE_ERROR' failed
(10:36:15) mattermost: Fetching url http://mattermost/api/v3/teams/guytssrcpfr8uk4yaxtrsuk7qa/channels/gdyh8mrycin5m86rf1xqmu45sb/posts/create
(10:36:15) mattermost: With postdata {"pending_post_id":"0000C9EAE251FFFF","channel_id":"gdyh8mrycin5m86rf1xqmu45sb","message":"(10:00:05) **Foo: **Bar\n(10:00:13) **Foo: **","user_id":"t674q3id5j8iudtbaa583csn5z","create_at":0}
Note the last "bar" is missing.
To reproduce in linux:
-
echo "<span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:05) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>Bar<br><span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:13) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>bar" | xclip -selection clipboard -i -t text/html
- Paste in chat
- Send
HTML seems to have other issues too. Things posted in angle brackets on mattermost disappear: the slack to mattermost bridge for instance puts atttributions in angle brackets