Tool for "unformatting"
Tool for "unformatting"
Hi all,
yesterday in the evening I had a long discussion with my customer. (You have heard of him ) And I am shocked .Hios content.htm is about 800 kB.
Because he thinks, that he is an Expert in WORD he thougth, that FCKeditor should do things like WORD.
He didn't checked for what CSS can be used.
In the Stylesheet of his template is defined:
body,td,p {
font-family:Verdana,Arial,Helvetica,sans-serif;font-size:9pt;
}
But he wants to have font-size: 8pt;
And so, in each table cell and very often in the running text, you can find
<p><span style="font-size: small;"><span style="font-family: Verdana;">Körperhaltung</span></span></p>
And now, its to late, to change the Stylesheet, because that will have effect only for the futere.
You can imagine: I am fully horrified.
First question: I think, it should be aesy with preg_replace to kill the two spans. But because I am always struggling with regular expressions (and most times I loose). Is there an Expert, who can give me the code?
Second question: I think, this will happen very often. Should it be a good idea, to write a tool for "unformatting" this formatting. Will it be simple and safe in using?
Third question: I dont know how, but I think, it will be nice, always to see, which font is active. Instead of the empty comboboxes. I am not sure, if it is poosible and if it is a goog idea.
Thanks for help
phg
yesterday in the evening I had a long discussion with my customer. (You have heard of him ) And I am shocked .Hios content.htm is about 800 kB.
Because he thinks, that he is an Expert in WORD he thougth, that FCKeditor should do things like WORD.
He didn't checked for what CSS can be used.
In the Stylesheet of his template is defined:
body,td,p {
font-family:Verdana,Arial,Helvetica,sans-serif;font-size:9pt;
}
But he wants to have font-size: 8pt;
And so, in each table cell and very often in the running text, you can find
<p><span style="font-size: small;"><span style="font-family: Verdana;">Körperhaltung</span></span></p>
And now, its to late, to change the Stylesheet, because that will have effect only for the futere.
You can imagine: I am fully horrified.
First question: I think, it should be aesy with preg_replace to kill the two spans. But because I am always struggling with regular expressions (and most times I loose). Is there an Expert, who can give me the code?
Second question: I think, this will happen very often. Should it be a good idea, to write a tool for "unformatting" this formatting. Will it be simple and safe in using?
Third question: I dont know how, but I think, it will be nice, always to see, which font is active. Instead of the empty comboboxes. I am not sure, if it is poosible and if it is a goog idea.
Thanks for help
phg
Re: Tool for "unformatting"
Unformat (or better "Remove Word formating") is included in FCKEditor already. But I alsoo had a problem on the beginning using this function. It shall be used like this:
1. Copy from Word
2. Click the "W" icon and check Remove formating. Only the paragraphs remain kept.
Or there is also "T" icon for inserting whatever as a plain text. Then the formating shall be done with FCKEDitor's functions.
1. Copy from Word
2. Click the "W" icon and check Remove formating. Only the paragraphs remain kept.
Or there is also "T" icon for inserting whatever as a plain text. Then the formating shall be done with FCKEDitor's functions.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Tool for "unformatting"
Hi,
I use PureText to remove formatting: no problems at all.
http://stevemiller.net/puretext/
Holger
Hmm, a simple search and replace should be fine too.phg wrote:First question: I think, it should be aesy with preg_replace to kill the two spans.
Just as a hint: that's not working with every browser. Be sure to check if it's working with your browser.Tata wrote:Unformat (or better "Remove Word formating") is included in FCKEditor already.
I use PureText to remove formatting: no problems at all.
http://stevemiller.net/puretext/
Holger
Re: Tool for "unformatting"
It works both in IE8 and in the latest FF. Not tested with Safari or Opera.Holger wrote:Just as a hint: that's not working with every browser. Be sure to check if it's working with your browser.
I use PureText to remove formatting: no problems at all. http://stevemiller.net/puretext/Holger
I also used puretext. But since there was this Unformat fnction available, I don't use it anymore. But it's also a way how to unformat.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Tool for "unformatting"
Hi Tata, Hi Holger,
no, thats not the thing I want. My customer will not loose the complete formatting.
BTW: He copied most from Word-Files. But I told him, to save in Word as Text only and then copy and paste. It was functioning perfect. All other tools we tried had problems.
Now we will only remove the special formatting for font-size: small; and font-family:Verdana. Because that formatting will be done by the Stylesheet.
no, thats not the thing I want. My customer will not loose the complete formatting.
BTW: He copied most from Word-Files. But I told him, to save in Word as Text only and then copy and paste. It was functioning perfect. All other tools we tried had problems.
Now we will only remove the special formatting for font-size: small; and font-family:Verdana. Because that formatting will be done by the Stylesheet.
Re: Tool for "unformatting"
Hmm, maybe Word should be the better CMS for your customer
Holger
Holger
Re: Tool for "unformatting"
Ok Holger,
I love your sarcasm, but you are not right. At all, my customer is enthusiastic about cmsimple.
If you like, look, what he has done:
http://www.drzeplin.de
http://www.fuehrungstipps.de
http://www.controlling4nachhaltigkeit.de
and as his playground/under construction
http://www.drzeplin.com/wastun
I do not stand always behind his content and the formatting, but I think: It is a lot since beginning of the year.
And he never uses html/css
I love your sarcasm, but you are not right. At all, my customer is enthusiastic about cmsimple.
If you like, look, what he has done:
http://www.drzeplin.de
http://www.fuehrungstipps.de
http://www.controlling4nachhaltigkeit.de
and as his playground/under construction
http://www.drzeplin.com/wastun
I do not stand always behind his content and the formatting, but I think: It is a lot since beginning of the year.
And he never uses html/css
Re: Tool for "unformatting"
Well, this is but so special requirements from your customer, that it is not worth to change anything within CMSimple. CMSimple has its very own rules. And basically web editting has nothing to do with usin of Word written sources. This must understand simply each CMSimple (or any other CMS user).
It has to be considered by each user that:
* CMS has its own formating rules and tools
* Web editting is absolutely different from Office docs editting
* Internet is something absolutely different from any pritable document
And then the user has to decide what he would prefer - artificial documents or online accessible and dynamically changible information; beautiful styled documents or fast and in real time actualized information.
I also know directors, who would like to see tricksful presentations of their own firm. There it runs fst (and they simply can't understand that it is fast because of reading from cache). And they also do not accept that online it may take 10x longer, so the visitors will never return to such website.). They do - and don't want to - understand what is the source code and how much of everythig-wasting information is there only because of their dummy requirements. I decline to make websites for them...
It has to be considered by each user that:
* CMS has its own formating rules and tools
* Web editting is absolutely different from Office docs editting
* Internet is something absolutely different from any pritable document
And then the user has to decide what he would prefer - artificial documents or online accessible and dynamically changible information; beautiful styled documents or fast and in real time actualized information.
I also know directors, who would like to see tricksful presentations of their own firm. There it runs fst (and they simply can't understand that it is fast because of reading from cache). And they also do not accept that online it may take 10x longer, so the visitors will never return to such website.). They do - and don't want to - understand what is the source code and how much of everythig-wasting information is there only because of their dummy requirements. I decline to make websites for them...
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Tool for "unformatting"
Hey thx Horst! So I'll keep it .phg wrote:I love your sarcasm
Holger
Re: Tool for "unformatting"
Hello,
now I wrote a little php-program, which does the unformatting: I tell him, which HTML-Tags should be cleared like
clear('<span style="font-family: Verdana;">');
clear('<span style="font-size: small;">');
it deletes them and the corresponding </span>. (<spans> may be nested!)
Before the content.htm was 815 kB, now it is 631 kB
Because all your customers are very well trained and will not do such chaotic things as mine, you do not need this little program
If suddenly such a customer arises : If you send me a mail, I will mail you that program.
phg
now I wrote a little php-program, which does the unformatting: I tell him, which HTML-Tags should be cleared like
clear('<span style="font-family: Verdana;">');
clear('<span style="font-size: small;">');
it deletes them and the corresponding </span>. (<spans> may be nested!)
Before the content.htm was 815 kB, now it is 631 kB
Because all your customers are very well trained and will not do such chaotic things as mine, you do not need this little program
If suddenly such a customer arises : If you send me a mail, I will mail you that program.
phg