2012-02-18 26 views
0

私はRitch-Text Editorのmozillaの例を使って、HEREを紹介しています。すべてがうまくいくようですが、ウェブページから単純なテキストをコピー/貼り付けするとき、不必要なHTMLタグがたくさん追加されます。たとえば、現在のページの最後の行をコピーする場合。恐ろしくテキストはJSリッチテキストエディタにコピー/貼り付け

 <p><span style="color: rgb(68, 68, 68); font-family: Arial, 'Liberation Sans', 
    'DejaVu Sans', sans-serif; font-size: 13px; line-height: 12px; text-align: left; 
background-color: rgb(119, 119, 119); ">site design/logo © 2012 stack exchange 
    inc; user contributions licensed under&nbsp;</span><a 
href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license" style=" 
    margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
    padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
    0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; 
    border-left-width: 0px; border-style: initial; border-color: initial; border-image: 
initial; font-size: 13px; vertical-align: baseline; background-image: initial; 
    background-attachment: initial; background-origin: initial; background-clip: 
    initial; background-color: rgb(119, 119, 119); color: rgb(68, 68, 68); cursor: 
    pointer; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; 
    line-height: 12px; text-align: left; ">cc-wiki</a><span style="color: 
    rgb(68, 68, 68); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', 
    sans-serif; font-size: 13px; line-height: 12px; text-align: left; background-color: 
    rgb(119, 119, 119); ">&nbsp;with&nbsp;</span><a 
    href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license" 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
    padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; 
    border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; 
    border-left-width: 0px; border-style: initial; border-color: initial; 
    border-image: initial; font-size: 13px; vertical-align: baseline; background-image: 
    initial; background-attachment: initial; background-origin: initial; background-clip: 
initial; background-color: rgb(119, 119, 119); color: rgb(68, 68, 68); cursor: pointer; 
    font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 12px; 
    text-align: left; ">attribution required</a></p> 

になります。これにより、テキストエディタは実質的に役に立たなくなります。 <b>,など

のようなメインのhtmlタグのみを貼り付けるようにするにはどうすればよいですか。あるいは、タグで取り除かれたテキストを貼り付けます。

問題は、フォームを送信した後、htmlタグがout editと混在するため、テキストエディタに貼り付ける前に行う必要があることです。

答えて

1

ほとんどのWYSIWYGエディタには、HTMLの可能性があります(htmlで記述します)。 あなたのエディタがそれを持っているかどうかをチェックしてください。

関連する問題