public void LoadHtmlFragment(string title, string blogPostBody, string baseUrl, BlogEditingTemplate editingTemplate)
        {
            _spellingManager.ClearIgnoreOnce();
            _templateContainsTitle = editingTemplate.ContainsTitle;

            //if any manually attached behaviors are attached, remove them.
            //Note: this is necessary to prevent errors from occuring when switching between wysiwyg and code view
            //to quickly.
            DetachBehaviors();

            // Deterministically dispose any automatically created behaviors.
            _elementBehaviorManager.DisposeCreatedBehaviors();

            if (TidyWhitespace && Editable)
            {
                blogPostBody = HTMLTrimmer.Trim(blogPostBody, true);
                if (blogPostBody != String.Empty)
                    blogPostBody += CONTENT_BODY_PADDING;
            }

            // SInce this action is reverted in the deattach of the behvaiors, we only do this in edit mode,
            // otherwie there is no deattach to balance it out.  See that AttachBehaviors() doesnt attach in edit mode
            if (Editable)
            {
                //attach the extended entry HTML behavior
                blogPostBody = PostBodyEditingElementBehavior.ApplyExtendedEntryBehavior(blogPostBody);
            }

            //Hack: cache the title and body HTML to avoid returning a bogus value
            //GetEdited[Html|TitleHtml] is called before the document behaviors are attached.
            _lastSetTitle = title;
            _lastSetBodyHtml = blogPostBody;

            preserver.Reset();
            blogPostBody = preserver.ScanAndPreserve(blogPostBody);

            // update html content with standard header and footer
            // Hack: put some padding at the bottom of the div so that the bottom line of text does not get
            // cutoff if it extends below the baseline (p's and g's sometimes cause issues)

            //put an ID'd span around the title so that editing behaviors can be attachd to it.
            //Note: use a span instead of a DIV as since DIVs can't be nested inside inline elements, so if
            //the title text was surrounded by inline tags (like font, or bold, etc) then the DIV would
            //break the rendering of the surrounding inline styles.
            string titleHtml = _strategy.OnTitleInserted(title);

            if (blogPostBody == String.Empty && TidyWhitespace)
                blogPostBody = "<p>&nbsp;</p>";

            blogPostBody = _strategy.OnBodyInserted(blogPostBody);

            string postHtml = editingTemplate.ApplyTemplateToPostHtml(title, titleHtml, blogPostBody);

            //add the base tag for the HTML so relative resource references in the post will be resolved.
            postHtml = postHtml.Replace("</HEAD>", String.Format(CultureInfo.InvariantCulture, "<BASE href=\"{0}\"></HEAD>", baseUrl));

            // save the content to a temp file for loading
            string documentPath = TempFileManager.Instance.CreateTempFile("index.htm");
            using (StreamWriter streamWriter = new StreamWriter(documentPath, false, Encoding.UTF8))
                streamWriter.Write(postHtml);

            // load the document
            base.LoadHtmlFile(documentPath);
        }