Muli Ben-Yehuda's journal

February 14, 2004

Filed under: Uncategorized — Muli Ben-Yehuda @ 3:32 PM

It’s days like these that make me appreciate free software. Whenever I
would post a blog entry with HTML’s ‘pre’ stanzas in it to
livejournal via ljupdate, the
entry would appear horribly mangled (exhibit
). That in itself is not too bad, since I could go immediately to
the livejournal website and edit it to display properly, but when the
entry got syndicated on kerneltrap, it would make the
page impossbile to view. Unacceptable – exhibit 2.

So I dug into the ljupdate source code to figure out what was going
on. It turns out that ljupdate would munge the text in order to
prepare it for livejournal’s incoming filters, which would demunge it
into proper HTML. Unfortunately, the munging would destroy ‘pre’
stanzas, rendering them all on one long line.

After ascertaining that this was the problem, I set out to fix
it. First I tried to get ljupdate to not munge ‘pre’ stanzas, but
then, after reading this
, I decided to implement an ‘HTML mode’ flag. A few hours
later and several tens of test posts later, it works.


is the ljupdate
fix. Now to integrate with ljablog.el

Filed under: Uncategorized — Muli Ben-Yehuda @ 12:37 AM

Rewrote ljablog.el’s main loop to be more lispish in nature. Sexy!

(defun ljablog-post () 
  "Post a ljablog entry to both livejournal and advogato."  
      '((lj-compose lj-post) 
        (advogato-start-post advogato-save-post)))) 
      (copy-region-as-kill (point-min) (point-max)) 
        (lambda (x) 
          (funcall (car x)) 
          (if ljablog-debug-do-post 
            (funcall (cadr x)))) 

Blog at