Hi, My problem is simple but I realy don't know how to do it.
I have a website where people edit text (with FCKeditor) and in their text, the copy-paste code. (like css, html, vbscript, java, etc..). The application is a code snippet database.
For the "code" to be different from the reste of the texte, I created a style named code that change the color, have a margin etc...
My problem is that when we copy-paste, FCKEditor ignore the tabs. So the code is not well indented.
I know the <pre> could do the job, but how can I use it. My "code" tag in the CSS is a div.
Can someone help me?
Thanks
Mon, 07/10/2006 - 10:04
#1
RE: Format code
You can do the following :
edit your XML styles file, and add a line like :
<?xml version="1.0" encoding="utf-8" ?>
<Styles>
<Style name="code" element="pre">
<Attribute name="class" value="code" />
</Style>
</Styles>
Then go to the css file and remove the div declaration for code, just declare a code class. Something like :
.code {
css instructions....;
}
Hope this helps.
Y.chaouche
RE: Format code