Implements reverse formatting methods (HTML->WikiMarkup).
コード例 #1
0
 /// <summary>
 /// Gets the edited content.
 /// </summary>
 /// <returns>The content.</returns>
 public string GetContent()
 {
     if (inWYSIWYG)
     {
         return(ReverseFormatter.ReverseFormat(lblWYSIWYG.Text));
     }
     return(txtMarkup.Text);
 }
コード例 #2
0
        protected void btnWikiMarkup_Click(object sender, EventArgs e)
        {
            SelectTab(0);

            //added for WYSIWYG
            //if last view was WYSIWYG take text from WYSIWYG to Markup
            if (inWYSIWYG)
            {
                txtMarkup.Text = ReverseFormatter.ReverseFormat(lblWYSIWYG.Text);
            }
            //end
        }
コード例 #3
0
ファイル: Editor.ascx.cs プロジェクト: ahmedfe/screwturn
 /// <summary>
 /// Gets the edited content.
 /// </summary>
 /// <returns>The content.</returns>
 public string GetContent()
 {
     if (inWYSIWYG)
     {
         ReverseFormatter reverseFormatter = new ReverseFormatter();
         return(reverseFormatter.ReverseFormat(currentWiki, lblWYSIWYG.Text));
     }
     else
     {
         return(txtMarkup.Text);
     }
 }
コード例 #4
0
        protected void btnPreview_Click(object sender, EventArgs e)
        {
            SelectTab(2);

            //added for WYSIWYG
            //if last view was WYSIWYG take text from WYSIWYG to Preview
            //in both cases I need to synchronize WYSIWYG and Markup view
            if (inWYSIWYG)
            {
                lblPreview.Text = lblWYSIWYG.Text.Replace("&lt;", "<").Replace("&gt;", ">");
                txtMarkup.Text  = ReverseFormatter.ReverseFormat(lblWYSIWYG.Text);
            }
            else
            {
                lblPreview.Text = FormattingPipeline.FormatWithPhase3(FormattingPipeline.FormatWithPhase1And2(txtMarkup.Text, false, FormattingContext.Unknown, null), FormattingContext.Unknown, null);
                //lblWYSIWYG.Text = lblPreview.Text;
                lblWYSIWYG.Text = Formatter.Format(txtMarkup.Text, false, FormattingContext.Unknown, null, out var links, true);
            }
            //end
        }