How to preserve whitespace in <pre> environment?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
svollmer
Posts: 4
Joined: Tue Jul 17, 2007 10:15 am

How to preserve whitespace in <pre> environment?

Post by svollmer »

Hi,

I have the following problem with phpMyFAQ 2.0.2: To format source code examples, I mark them as "Preformatted". In the HTML view, they are represented as <pre> ... </pre> blocks.

But when some lines are indented, the whitespace at the beginning of each line gets deleted when I close/reopen the "edit article" page.

How can I write code examples like this?

Code: Select all

begin
  if (true) {
    foo;
  } else {
    bar;
  }
end; 
always gets reformatted as:

Code: Select all

begin
if (true) {
foo;
} else {
bar;
}
end;
Many thanks in advance!
svollmer
Posts: 4
Joined: Tue Jul 17, 2007 10:15 am

Post by svollmer »

Does nobody have an idea how I can format source code that is properly indented?

Thanks in advance, Stephan
Post Reply