-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for formatted test #122
base: main
Are you sure you want to change the base?
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 |
Thanks for the help @dylex and @kacf :) I should have paid more attention to the function that does in-place modification, so added some safety to it (should upstream for the discord prpl too) |
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 <[email protected]>
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 :)