how to achieve indentations in forum posts?

Hello!

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

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):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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

There are several tags that can be used within <>:

a
em
strong
cite
code
ul
ol
li
b

are some of them. The code tag has to be used on every line break.

Jeff,

thank you for the hint - the last remark in your post seems to be the important one!

Kind regards,

Andreas Rozek

views:1557 update:2011/9/21 18:18:19
corona forums © 2003-2011