系統自動排版

時間:2020/4/2 16:26:38,點擊:0

<script type="text/javascript">
function format1()
{
        var body = "\n"+document.getElementById("thebody").value;
        body = body.replace(/[\r\n]+/g,"\n").replace(/^\n|\n$|\s+$|[ ]+|\t+/mg,"");
        body = body.replace(/<\/?a[^>]*>/ig,"");
        body = body.replace(/<p>(&nbsp;|\s)*<\/p>/g,"");
        body = body.replace(/^\s*/gm,"    ");
        body = body.replace(/&nbsp;/g,"");
        document.getElementById("thebody").value=body;
}
function format2()
{
        var body = "\n"+document.getElementById("thebody").value;
        //body = body.replace(/ |??/ig,"");
        body = body.replace(/\r\n/ig,"\n");
        body = body.replace(/\n\n/ig,"\n");
        body = body.replace(/\n\n/ig,"\n");
        body = body.replace(/\n\n/ig,"\n");
        body = body.replace(/\n\n/ig,"\n");
        body = body.replace(/\n/ig,"\n\n");
        body = body.replace("\n\n","");
        document.getElementById("thebody").value=body;
}

</script>
<form method="POST" name="KKsForm">
      <textarea name="Content" rows="25" cols="20" id="thebody"></textarea>
</form>
<input class="button" name="body1" onclick="format1()" title="系統自動排版" type="button" value="自動排版">
<input class="button" name="body2" onclick="format2()" title="自動段間空行自動排版" type="button" value="添加空行">

打印 | 關閉

国产亚洲日韩欧美视频_免费国产久久拍久久爱