Add support for formatted test#122
Conversation
|
Very much appreciated! However, I got a crash when I used this and tried to send a message. I used an It looks like it's in a different section, so probably the memory error has already happened sometime earlier. |
|
Yeah, since posting the PR, I've been seeing approx 5% of sent messages having some kind of memory error - either an outright crash, or the message body gets replaced with the channel ID - but when I step through with gdb everything looks ok (stupid heisenbugs!) I don't have access to valgrind (since I'm on Windows) but do you think you could run Pidgin through valgrind @kacf to see if it reveals where the corruption is happening? The other bug I'm seeing after this PR is that incoming smileys which have underscores in them, eg |
|
In a very cursory try I'm getting: Which looks like escaped is getting freed twice. Probably |
|
Great! I will retry! (sorry, I was planning to do the Valgrind thing, but time flies and dylex beat me to it!) |
`markdown_html_to_markdown()` returns a malloc'ed variable and frees the input variable. Therefore it is `marked` we need to free, not `escaped`. Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
|
It's still not quite right. The On a side note, I could not get code blocks to render any differently than normal text, but I can see from the log that the correct HTML is indeed there, so this may be a Pidgin issue, and not a Slack plugin issue. |
Fix incorrect free()'ing of markdown variables.
(Got a little annoyed at copy-pasting tags into messages and then getting stuck, but then took it a whole bunch further...)
This PR uses the markdown conversion code from purple-discord, tweaked for Slack's flavour of markdown, and uses it to convert to/from HTML (or specifically, Pidgin's HTML)
Would be good to get some tests/feedback on it :)