When displaying code snippets (or other preformatted content) it would be useful to keep line indentations as they are.
But, although both the “textarea” control and the forum itself seem to keep the indentations as they have been entered, leading whitespace does not seem to be displayed within the browser…
On the other side, there *are* some contributions in this forum which *do* display line indentations - thus, it seems to be prinicipally possible!
For that reason: where is the trick?
Thanks in advance for any help!
Andreas Rozek [import]uid: 4331 topic_id: 362 reply_id: 300362[/import]
Try pasting the formatted code after the “code” tag listed at the bottom. It should keep the indenting until it hits a blank line (eg. the second listing below has a blank line after the “local b” line):
[code]
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “beep.caf” )
end
[code]
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “beep.caf” )
end
– Walt Sterdan [import]uid: 4329 topic_id: 362 reply_id: 629[/import]