Commit a65b03d6 authored by Emma Bednaříková's avatar Emma Bednaříková
Browse files

paste: paste_preprocess

parent 62af96fb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -38,6 +38,13 @@ tinymce.init({
  force_p_newlines: true,
  paste_block_drop: false,      // prevents flattening blocks
  paste_data_images: false,
  paste_preprocess: function (plugin, args) {
    args.content = args.content
      .split(/\r?\n/).map(line => line.trim())
      .filter(line => line.length > 0)
      .map(line => `<p>${line}</p>`)
      .join('');
  },
  resize: false,
  width: '100%',
  height: '100%',