wysihtml5 bootstrap3-wysiwyg字体大小和<p>到<br/> </p>

时间:2015-02-05 14:23:30

标签: wysihtml5 bootstrap-wysihtml5

我根据bootstrap3-wysiwyg

使用wysihtml5

我寻求解决方案

  1. 在“输入”键上插入“br”而不是“p”

  2. 使用输入值更改字体大小的按钮

1 个答案:

答案 0 :(得分:2)

  1. 使用&#39; br&#39;
  2. $("#TextContent").wysihtml5({useLineBreaks: true, ...})
    
    1. 字体大小
    2.   var myCustomTemplates = {
      
          custom1: function (context) {
              var s = ""
              s += '<li class="dropdown">';
              s += '<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1" aria-expanded="false">';
              s += '<span class="current-color">Size</span>';
              s += '<b class="caret"></b>';
              s += '</a>';
              s += '<ul class="dropdown-menu" style="margin-top: 0px;">';
              s += '<li><a class="fontSize" data-wysihtml5-command="fontSize" data-wysihtml5-command-value="fs5">5px</a></li>';
              s += '</ul>';
              s += '</li>';
      
              return s;
          }
      };
      
       $("#TextContent").wysihtml5(
              {
                  customTemplates: myCustomTemplates,
                  "stylesheets": ["~/Content/wysiwyg/editor.css"]
              });
      

      editor.css

      .wysiwyg-font-size-fs5 {
          font-size: 5px;
      }
      
相关问题