See the diff output here:
http://www.davidgrant.ca/digg_43things_and_drupal_via_xml_rpc
The codefilter is removing the first space of every line, and that screws up the indentation... This is what it looks like on my site, (I used the pre tag here)
--- blogapi.module.orig 2006-07-30 00:43:52.000000000 -0400
+++ blogapi.module 2006-07-30 02:41:20.000000000 -0400
@@ -191,6 +191,7 @@
}
$edit = array();
+ $blogid = 'story';
$edit['type'] = _blogapi_blogid($blogid);
// get the node type defaults
$node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote'));
It looks even weirder on drupal.org (using code tag):
--- blogapi.module.orig 2006-07-30 00:43:52.000000000 -0400
+++ blogapi.module 2006-07-30 02:41:20.000000000 -0400
@@ -191,6 +191,7 @@
}
$edit = array();
+ $blogid = 'story';
$edit['type'] = _blogapi_blogid($blogid);
// get the node type defaults
$node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote'));
Comments
Comment #1
johnalbinPerhaps this has been fixed? Your second example looks totally fine to me.
Comment #2
johnalbinI've now been bitten by this bug while editing Drupal documentation.
Comment #3
johnalbinSpecifically, the leading spaces in comments are not converted to like the leading spaces in PHP code are.
Comment #4
john morahan commentedEven more specifically, codefilter appears to be converting
's to spaces. It correctly avoids doing this when two of them appear together, but does not avoid doing it when a single appears at the beginning of a line. Witness:Comment #5
john morahan commentedHmm, that didn't quite get them all.
Comment #6
cs8c commentedJohn Morahan - Your patch really corrected a major problem, thanks! I was about to give up on pasting code because it was just not showing up right until now, I needed to disable the filter and then re-enable it to show the changes though.
Comment #7
john morahan commentedThat's to be expected, as filter output is cached; running update.php should also work.
Comment #8
q0rban commentedI've got this problem as well inside
<?phptags. It's even doing it on drupal.org, as you can see below:Comment #9
deviantintegral commentedAt the least, this is a problem with 6.x.
Comment #10
deviantintegral commentedThe patch in #5 was not working for me. Here's a patch that does two preg_replace() calls instead for clarity.
I had to test against 6.x-1.0 as 6.x-1.x was causing PHP to segfault on my MAMP installation. As well, this patch can be cherry-picked to master, but I haven't tested that either.
Comment #11
deviantintegral commentedWhoops.
Comment #12
cameron tod commentedCommited and pushed to the 6.x-1.x branch, thanks!
Comment #13
cameron tod commentedComment #14
cameron tod commentedHappy days; this patch applied directly to the 7.x-1.x branch with no modification. Pushed, and thanks again!