【问题标题】:Summernote codeview text overflow wrapSummernote codeview 文本溢出换行
【发布时间】:2017-12-08 21:31:34
【问题描述】:

我用的是summernote,它是codeview。我的问题是,如果字符串太长,它会变成无穷大。我想溢出包装它。所以我不需要水平滚动。

有什么线索吗?

这是我的启动代码。

    var summernote = $('#description').summernote({
        height: 1000,                 // set editor height
        minHeight: null,             // set minimum height of editor
        maxHeight: null,             // set maximum height of editor
        maxWidth: 100,             // set maximum width of editor
        toolbar: [
          ['style', ['style']],
          ['font', ['bold', 'italic', 'underline', 'clear']],
          // ['font', ['bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'clear']],
          ['color', ['color']],
          ['para', ['ul', 'ol', 'paragraph']],
          ['insert', ['link', 'picture', 'hr']],
          ['view', ['fullscreen', 'codeview']],   // remove codeview button
          ['help', ['help']]
        ],
        codemirror: {
          mode: 'text/html',
          htmlMode: true,
          lineNumbers: true,
          theme: 'monokai'
        },
        callbacks: {
          onInit: function() {
            console.log('Summernote is launched');
            $(this).summernote('codeview.activate');
            $('#title').focus();
          }
        }
    });

【问题讨论】:

    标签: javascript wysiwyg summernote


    【解决方案1】:

    添加

    lineWrapping: true,
    

    在 lineNumbers: true 之后, 为我工作

    【讨论】:

      猜你喜欢
      • 2021-10-04
      • 2016-04-24
      • 1970-01-01
      • 2021-07-30
      • 2018-04-19
      • 2019-08-09
      • 2021-10-05
      • 2011-12-24
      • 1970-01-01
      相关资源
      最近更新 更多