<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>This works better.  Don't make me fork it:
&lt;pre&gt;
unsafeWindow.addComment = function paragraphify(id) {

  var form = document.forms.namedItem(id);

  var text = form.elements.namedItem(&quot;text&quot;);

  text.value = '&lt;p&gt;' + text.value
  text.value = text.value.replace(/(\n+)/g,'&lt;/p&gt;&lt;p&gt;$1');
  text.value = text.value + '&lt;/p&gt;'

  addComment(id);

};

&lt;/pre&gt;</body>
  <body-html>This works better.  Don't make me fork it:
&lt;pre&gt;
unsafeWindow.addComment = function paragraphify(id) {

  var form = document.forms.namedItem(id);

  var text = form.elements.namedItem(&quot;text&quot;);

  text.value = '&lt;p&gt;' + text.value
  text.value = text.value.replace(/(\n+)/g,'&lt;/p&gt;&lt;p&gt;$1');
  text.value = text.value + '&lt;/p&gt;'

  addComment(id);

};

&lt;/pre&gt;</body-html>
  <created-at type="datetime">2009-03-12T01:59:54Z</created-at>
  <forumable-id type="integer">22956</forumable-id>
  <forumable-type>Script</forumable-type>
  <id type="integer">101998</id>
  <topic-id type="integer">23048</topic-id>
  <updated-at type="datetime">2009-03-12T02:01:04Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">1083</user-id>
</post>
