alanj: (Default)
alanj ([personal profile] alanj) wrote in [site community profile] dw_dev2013-05-21 04:58 pm
Entry tags:

Bug 4527 bounty

I'll donate $100 to the Electronic Freedom Foundation in the name of anyone who gets Bug 4527 (crossposting Markdown results in bare syntax on remote site) fixed, payable when the fix shows up in production ;)

I would really like to start using Markdown. Unfortunately most of my friends are not cool enough to use Dreamwidth, so I am dependent on crossposting, so this issue makes Markdown use impossible for me. It should be a very small patch; my guess when I looked at it was under 10 lines, though proper error-handling and comments and such will bump it up some.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2013-05-22 08:09 am (UTC)(link)
for those wondering, yes, i told [personal profile] alanj it was okay to post a bounty on this. :)
kaberett: Trans symbol with Swiss Army knife tools at other positions around the central circle. (Default)

[personal profile] kaberett 2013-05-22 11:58 am (UTC)(link)
Hmmm, I say.
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2013-05-23 01:19 am (UTC)(link)
I just took a pass at this because, as you say, it's like 10 lines of code.

The one finicky part is that Markdown has to turn on preformatted mode since the HTML it builds includes paragraph spacing in the HTML. The crossposter implementation (and this isn't bad, it just IS) has its own cleaner and doesn't have a way for me to bubble up "please set opt_preformatted when you post this to the remote".

I will have to ponder how to plumb that without a gross hack worthy of turning in my badget. I'm sure there's a way...

For those following along at home, here's the patch so far:

https://github.com/xb95/dw-free/commit/2a9e8c791baf3ec5b4504b192793fd29d12b61d3

I will see if I can fix it up and get it finalized, but if someone else gets to it first, awesome! Please do.
alierak: (Default)

[personal profile] alierak 2013-05-23 04:38 pm (UTC)(link)
I also glanced at it yesterday, and my first thought was to wonder whether any of the lj-protocol sites we support are also using our Markdown support, in which case we might not want to preformat for those? DW in particular appears in the list, and while I don't see much use for people crossposting Markdown between fellow DW accounts, it might get used by people running their own. Trying to decide if we need a "dw" protocol to do something like this, or just another field in the external sites to indicate Markdown support.
alierak: (Default)

[personal profile] alierak 2013-05-23 04:48 pm (UTC)(link)
Oh, but purposely crossposting Markdown would probably still have to involve a little bit of translation for domains of @-style user tags.
allen: extras (extras)

[personal profile] allen 2013-05-23 08:50 pm (UTC)(link)
$entry->props->{opt_preformatted} = 1;

Seriously. Well, and add in a couple of comments saying that it can happen. We have much worse side-effects in our code.

As an alternative, make it


# clean the entry text, modify properties, etc.
my $entry = $self->clean_entry( $entry, $extacct );
my $req = {
'subject' => $entry->subject_text,
'event' => $entry->event_raw,
'security' => $entry->security,
};


That way it's more explicit that you're modifying the entry object. But, eh.