Last modified: 2011-12-15 03:32:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35111, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33111 - <source> strips whitespace before the first line
<source> strips whitespace before the first line
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-14 15:43 UTC by Liangent
Modified: 2011-12-15 03:32 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2011-12-14 15:43:09 UTC
Sometimes it breaks code formatting.
Comment 1 Brion Vibber 2011-12-15 01:13:54 UTC
It shouldn't generally... empty lines before your program don't tend to mean anything, while an initial blank line is verrrrrry common due to the syntax:

<source lang="xyz"> <-- NEWLINE
first line of source
second line of source
</source>

We don't want to add extra blank lines to represent that empty start.

Is there an example where we would in fact want blank lines here? If so we'd still need to handle that first newline case.
Comment 2 Liangent 2011-12-15 03:31:51 UTC
(In reply to comment #1)
> Is there an example where we would in fact want blank lines here? If so we'd
> still need to handle that first newline case.

<source lang="php">
	$a = 1;
	$b = 2;
</source>

generates

+--------------------------------------------------------------+
| $a = 1;                                                      |
|        $b = 2;                                               |
+--------------------------------------------------------------+

but this looks better:

+--------------------------------------------------------------+
|        $a = 1;                                               |
|        $b = 2;                                               |
+--------------------------------------------------------------+

This does not happen if I replace tabs with spaces.
Comment 3 Liangent 2011-12-15 03:32:52 UTC
It seems Bugzilla converts tab to space so the input should be:

<source lang="php">
[TAB]$a = 1;
[TAB]$b = 2;
</source>

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links