Opened 13 years ago

Closed 13 years ago

#72 closed enhancement (wontfix)

EnterParagraphs Suggestion - adding class= attributes to <p> tags

Reported by: yermol Owned by: yermol
Priority: normal Milestone:
Component: Xinha Core Version: 0.1
Severity: normal Keywords:
Cc:

Description

The idea for EnterParagraphs is this:

Right now onEnter it inserts <p>'s instead of <br>'s. We've all decided this is the correct behavior. Unfortunately users don't want to see what they perceive as a double newline when they press Enter.

But using <br>'s is a problem for multiple reasons.

It's probably more "correct" to use stylesheet entries to manage the appearance of <p> tags. So, what if we modified EnterParagraphs so that onEnter the <p>'s that were inserted had an option class=".." attribute from some style sheet entry.

Then, the Xinha integrator could decide how they want the <p>'s for the editor generated content to behave.

This is better than hardcoding the style, since it's not easy to modify then. it's also better than overriding the default <p> stylesheet entry because it won't bother the rest of the page.

We'd pass in basically two config parameters, onEnterStyle and onShiftEnterStyle ... no more <br>'s at all. This means we'd have to intercept the Shift-Enter behavior in htmlarea.js as well.

Obviously this would be optional behavior to maintain backwards compatibility.

Change History (1)

comment:1 Changed 13 years ago by yermol

  • Resolution set to wontfix
  • Status changed from new to closed

Was a bad idea, as gogo pointed out. It's better just to wrap the Xinha generated content in a <div> and handle it that way.

Note: See TracTickets for help on using tickets.