要去掉开始和结尾的p标签,让内容直接在body中,而不是去掉回车的那个p,回车的那个p我已经去掉了,高手帮忙

解决方案 »

  1.   

    不要P标签吗?
    那好办value.Replace("<p>","").Replace("</p>",""); 这就都没了。呵呵
      

  2.   


    public string checkStr(string html)
            {
                System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"</p>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@"<p>", 
                html = regex1.Replace(html, ""); 
                html = regex2.Replace(html, "");
                return html;
            } 
      

  3.   

    参考
    http://blog.163.com/sun__haiming/blog/static/12830906820099725122903/?fromdm&fromSearch&isFromSearchEngine=yes
      

  4.   

    在ckeditor里的ckeditor.js中修改enterMode:2即可
      

  5.   

    看来你这个特殊要求,挺难搞的。
    有终极的解决办法。I/O输出html文件,再查找替换
    value.Trim().Replace("<body><p>","<body>").Replace("</p></body>","</body>")
      

  6.   

    //去掉底下的body p标签
        config.removePlugins = 'elementspath';