[pmwiki-users] blank line at start of html output

Petko Yotov 5ko at 5ko.fr
Tue Apr 29 19:09:14 CDT 2014

I have looked at the output in a hex editor and there are indeed two new  
line characters \x0a and no BOM.

I didn't ask about an obvious possible cause: there shouldn't be a blank  
line or any characters before the first <?php of the scripts.

So, I'd check these two files and all other included files for a blank line  
before the opening <?php tag, and for a closing ?> tag.


John Rankin writes:
>> Your messages seem to indicate that when the wiki loads either  
>> includeurl.php, or backup_pages.php, or both, there is exatcly one, not two,  
>> blank line ("\n") at the top of the HTML output, but when both recipes are  
>> commented out and not loaded, there is no blank line(s).
>> Can you confirm this?
> Almost. If either recipe is loaded, there is one blank line. If both are  
> loaded there are 2 blank lines. Using a regular expression match test, the  
> blank lines match "\n".
>> If yes, I'd check if this is not some Byte Order Mark (BOM), ie. files were  
>> modified with a text editor and saved in "UTF-8 encoding with BOM", while  
>> they should be saved "without BOM" in a text editor which allows this.
> I asked my user to run a wiki page against the W3C html validator and it  
> doesn't return any validation errors. However, I don't know for sure if  
> presence of a BOM constitutes an html validation error.
> I'll ask him to try saving the files without BOM and see what happens. We  
> have found a work-around that fixes the problem for PublishPDF that works  
> for this particular use case, but it is not a general solution, so it would  
> be good to get to the bottom of this.
> There is an example at http://metastudies.net/pmwiki/pmwiki.php? 
> n=Site.USPatent146407 -- using View Page Source shows 2 blank lines at the  
> start of the html.
>> If no, I'd check any and all files in the pmwiki/local and pmwiki/cookbook  
>> directories for a closing "?>" marker and for a BOM. And all files that the  
>> person may have modified in the pmwiki/scripts directory.

More information about the pmwiki-users mailing list