Categories
WordPress

Formatting frustrations

Gah. I just spent a considerable amount of time doing the layout and formatting for the first plugin post, and I discovered a few frustrating aspects of WordPress’s formatting:

  1. When saving/publishing an entry that is in need of a closing tag, WordPress seeks to close it for you. Appreciated behavior, when it works properly. I’ve found that if a close tag is not present and WP inserts it for you, it is sometimes either (a) in the wrong spot (i.e. closes a mid-list <li> at the end of the <ol>/<ul> -or- (b) worse, it eats up some of the entry text in doing whatever it was doing. There is already a bug tracker item on this.
  2. If I had continued that lowercase sublist and put in a ( c) [without the space before the ‘c’, I would’ve wound up with a ©, which I wouldn’t have wanted. This is a result of wptexturize() (see next item)
  3. I was having a hell of a time figuring out why I was getting curly quotes for all single- and double-quote characters. Checking out the source of the page in my browser, I saw that single-quote characters were replaced with either &#8216; or &#8217;, and double-quote characters were replaced with &#8220; or &#8221;. This was when I discovered that wptexturize(), in /wp-includes/functions-formatting.php, was the culprit. As a result, I wrote a mini-plugin, wpuntexturize (the plugin is being pre-linked since I haven’t created the page for it yet as of this posting). The mini-plugin goes back and reverts some of wptexturize’s changes to what I had used originally. I could just as easily have commented out those four lines in the function and be done with it, as well as spared the processing of the replace and unreplace, but I’m currently of the mindset to limit modifications to the core files as much as possible.