#161 Adding TH as a block element for the formatter

Version 2.x
closed-fixed
Editor (144)
5
2005-12-23
2005-10-15
No

If a table has TH elements, then the formatter doesn't
take them into account. All that is needed is to change
the regexps in fckcodeformatter.js adding them like is
done with TDs:

// Regex for line breaks.
FCKCodeFormatter.Regex.BlocksOpener =
/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi
;
FCKCodeFormatter.Regex.BlocksCloser =
/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi
;

Regards.

Discussion

  • Alfonso Martinez

    Logged In: YES
    user_id=1356422

    Another related problem with TH: they aren't filled with
      like TD if the cell is empty and
    FCKConfig.FillEmptyBlocks is true.

    To fix it just add the TH to the FCKRegexLib.BlockElements
    in internals\fckregexlib.js :

    FCKRegexLib.BlockElements =
    /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH|TABLE|CAPTION)$/i
    ;

    Just in the same file, the ObjectElements regex also is
    missing THs, adding should help to be able to style them (I
    haven't tested still that)
    // Used by the Styles combo to identify styles that can't be
    applied to text.
    FCKRegexLib.ObjectElements =
    /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT)$/i ;

     
  • Frederico Caldeira Knabben

    • assigned_to: nobody --> fredck
    • status: open --> open-fixed
     
  • Frederico Caldeira Knabben

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks