I usually like to use Word to write a Blog, but when I use it to open published articles, the default font will be changed to the fourth, and the font will become larger after I publish it again. For example, my original article was:
<P> Hello 123 </p>
When opened in Word, the html code generated after the re-release is as follows:
<P> <span style = "font-family:; font-size: 12pt"> Hello 123 </span> </p>
It is different from the original one. The entire article has become much larger.
I initially thought it was a bug in the blog garden and asked the garden a question. Then I got a reply that it was a Word Bug. I captured the packet and read it. This is indeed a Word Bug. When I opened the article, no style information was returned. However, Word independently added a small four style to the default font, this is not the case if you use another blog tool. However, this Bug is no problem as long as it is not enabled and re-edited, and the impact is not great, so you are too lazy to care about it.
In the past two days, I want to modify the two articles I wrote earlier, and then I am depressed by this Bug. Although other Blog clients do not have this Bug, their editing capability and Word are not at the same level. After I searched the internet, I did not find any solution, nor could I expect Word to take the initiative to solve this Bug. So I had to solve it myself.
I have previously written a tool used to solve the Bug that Word cannot publish images-I used word2007 to publish a blog with images on the blog garden. To solve this problem, the idea is the same: Write a proxy program, capture the Blog post published by Word, modify it, and forward it to the server.
Since the article is very old, the Code has been deleted for a long time, so it cannot be referenced. In addition, the original code is troublesome, that is, you have to virtualize a new account to forward the article. It is troublesome to set and use it.
Refer to previous solutions and problems. The solution used this time is to write a proxy program. After the program is started, modify the system proxy settings to this program to automatically capture Blog articles published by Word, after modification, it is forwarded to the server.
After the modification scheme is developed, I feel like a small Fiddler. I simply implemented it using Fiddler. Since Fiddler has completed most of the work, I have three lines to implement the key code:
FiddlerApplication. BeforeRequest + = OS =>
{
If (! OS. fullUrl. Contains ("/TianFang/services/metaweblog. aspx "))
Return;
OS. bBufferResponse = true;
OS. utilReplaceInRequest ("style = \" font-family:; font-size: 12pt \"","");
};
To better use it, I wrote a WinFrom Program (. net 2.0 Environment): Click to download
This program is very simple to use and does not need to be set. As long as you open it when using it, when you want to publish the modified article, it will automatically remove the extra four font size settings.
Note:
- The default API address may only apply to the Blog. If you want to use another Blog, modify its API address. The program will remember it and will still use it the next time you open it.
- This program modifies the global proxy settings, which may affect the network speed of the Internet. Therefore, it is best not to open it when you do not need it.