Improve XHTML formatting
Posted: 17 June 2007 01:58 AM   [ Ignore ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15167
Joined  05-15-2004

We all know and, presumably, love the way “Formatting: XHTML” handles our weblog entries. Still, I’d think there was room for some improvement, because in a number of cases blindly replacing every linebreak with <br /> and every double line break with <p> ... </p> is not necessarily the most elegant solution.

I’d go as far as saying that in the cases of <table>, <ul>, <ol>, <dl> and probably a few others this behavior is definitely unwanted by most people, even though the rest of the entry could profit from normal formatting: this is why neither choosing “Formatting: None” nor “keeping your table on a single line” are really satisfying solutions, all things considered.

I know, of course, that all that XHTML and typography parsing is a difficult issue, so we won’t get it for 1.6, I’m sure. Still, I think this FR might prove somewhat popular, and I wanted to make it. Thanks for considering.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 17 June 2007 06:42 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15743
Joined  06-03-2002

Most of these tags already have the “blind inserted” <p> and <br /> tags removed from them—you do not have to always keep the markup on a single line.  Tables being an exception, we currently have no special handling for table tags within Auto-XHTML fields.  But typically only when you begin more complex nesting of these other tags does the current parser not handle these situations.

That said, overall, yes, typography will likely be getting some major enhancement in 2.0.

 Signature 
Profile
MSG
 
 
Posted: 10 July 2007 02:12 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  169
Joined  06-18-2007

Hi

I believe the best feature of Auto XTHML is its automatic handling of “fancy quotes” etc. That’s the only reason I use it. However, its dodgy behaviour with ul,li,table etc is irritating. I think the engine should just switch off when it sees any <div>, <ul> <ol> or <table> tag and switch on again after it.

Clealy the person using those tags knows HTML and wants to do manual coding within those tags.

Profile
 
 
Posted: 10 July 2007 06:15 AM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15743
Joined  06-03-2002

So what about this, Richard?

<ol>
    <
li>Turn left on Foo Avenue</li>
    <
li>Turn Right on Bar Avenue.
        (
After 4pm, you will need to turn Left on Bar)
    </
li>
    <
li>Arrive at destination.</li>
</
ol>

Is it not reasonable to expect that the user will want a <br /> after “Bar Avenue.”, but not want one after “on Bar)”?  Parsing text unfortunately is not such a straightforward matter of “switching off” when encountering tags.

Clealy the person using those tags knows HTML and wants to do manual coding within those tags.

The only time it is honestly safe to make that assumption is with a formatting type of “None”.  However, if you find yourself only using XHTML typography for quote handling, can I recommend that instead of Auto XHTML typography that you use the XHTML Typography plugin, with the “light” setting?  I think you’ll end up with precisely what you are looking for.

 Signature 
Profile
MSG
 
 
Posted: 15 July 2007 11:46 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  169
Joined  06-18-2007

Thanks for the points; the plugin will help!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64548 Total Logged-in Users: 16
Total Topics: 81143 Total Anonymous Users: 17
Total Replies: 436542 Total Guests: 205
Total Posts: 517685    
Members ( View Memberlist )