こんにちは私はTinyMCEエディタを作成しようとしています。これはユーザーがどこからでも貼り付けるためです。TinyMCEの貼り付け時に上付き文字と下付き文字しか保持しない
唯一の制約は、ソースから貼り付けたTinyMCEボックスで、上付き文字と下付き文字を除くすべてのリッチテキストプロパティ(色、フォントスタイル、見出し、表など)を削除する必要があるということです。
上付き文字と下付き文字のみを保持します。
ここは私のTinyMCEコードです。現在私はpaste_as_text:trueを使用しているので、上付き文字と下付き文字を含むすべてのリッチテキストスタイルを削除しています。
http://fiddle.tinymce.com/KAfaab/4
<script type="text/javascript">
tinyMCE.init({
selector: 'textArea', // change this value according to your HTML
menubar: false,
width: "840",
toolbar: 'undo redo | superscript subscript | link image',
height: "225",
resize: 'both',
encoding: "xml",
elementpath: true,
paste_word_valid_elements: "superscript,subscript,sub,sup",
plugins: "paste",
paste_retain_style_properties: "superscript,subscript,sub,sup",
paste_as_text:true
});
<form method="post" action="dump.php">
<textarea name="content"></textarea>
</form>