Changeset 6

Show
Ignore:
Timestamp:
11/15/07 15:55:41 (1 year ago)
Author:
brennan
Message:

set editor to not wrap the content in the body using a tidy.config setting

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ClassLibrary/MarkupCleaner.cs

    r5 r6  
    129129        public string GetBodyContent(string content) 
    130130        { 
    131             int startIndex = content.IndexOf("<body>") + "<body>".Length; 
     131            string startMarker = "<body>"; 
     132            string endMarker = "</body>"; 
     133            int startLength = startMarker.Length; 
     134            int startIndex = content.IndexOf(startMarker); 
    132135            if (startIndex != -1) 
    133136            { 
    134                 int endIndex = content.IndexOf("</body>"); 
    135                 return content.Substring(startIndex, (endIndex - startIndex)); 
     137                int endIndex = content.IndexOf(endMarker); 
     138                return content.Substring( 
     139                    startIndex + startLength, (endIndex - startIndex + startLength)); 
    136140            } 
    137141            else 
  • trunk/Website/Controls/EditorControl.ascx.cs

    r5 r6  
    5353        MarkupCleaner cleaner = new MarkupCleaner(); 
    5454        cleaner.OptionFile = Server.MapPath("~/Controls/tidy.config"); 
    55         string cleanedContent = cleaner.CleanContent(Content); 
    56         Content = cleaner.GetBodyContent(cleanedContent); 
     55        Content = cleaner.CleanContent(Content); 
    5756        OnContentSaved(EventArgs.Empty); 
    5857    } 
  • trunk/Website/Controls/tidy.config

    r5 r6  
    66markup: yes 
    77quiet: yes 
     8show-body-only: yes