JS正则过滤(去除)富文本编辑器中的FONT-SIZE标签
2017-02-10 11:38
218 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JS正则过滤编辑器样式font-size:xx;</title> <script language="javascript"> function show(){ var test="<p>\n\t<img src=\"http://localhost/Scripts/KindEditor/Editor/plugins/emoticons/images/0.gif\" alt=\"\" border=\"0\" />ds<em>fds</em>\n</p>\n<p>\n\ts<span style=\"font-size:16px;\">dfd</span>sf<img src=\"http://localhost/Scripts/KindEditor/Editor/plugins/emoticons/images/19.gif\" alt=\"\" border=\"0\" />ds<strong>fdsfds</strong>\n</p>\n<p>\n\t<br />\n<strong></strong>\n</p>\n<p align=\"center\">\n\t<strong>d<span style=\"font-family:FangSong_GB2312;\">ssa</span>dasasdsad<u>dfds</u><br />\n</strong>\n</p>"; var test=test.replace(/font-size:\w+;?/g,''); document.getElementById("sd").innerHTML=test; } </script> </head> <body onload="show();"> <div id="sd"></div> </body> </html>
相关文章推荐
- Ueditor富文本编辑器替换去除自动追加p标签
- js过滤(去除)富文本编辑器中的html标签和换行回车等标记的正则表达式
- php读取富文本编辑器编辑后的文章内容,并去除所有html标签、空格以及空白,截取字符串(包括中文)
- 百度UEditor富文本编辑器去除过滤div等标签
- font-size和font标签的size属性的区别
- 去除富文本编辑器中的标签
- 不要通过html中font标签的size属性来更改文字的精确大小
- 百度UEditor富文本编辑器去除自动追加p标签
- JS过滤(去除)富文本编辑器中的HTML标签和换行回车等标记的正则表达式
- sizeWithFont:constrainedToSize:lineBreakMode的使用 (2012-03-20 10:48:40)转载▼ 标签: 宽度 字符串 获取 指定 用于 杂谈 分类:
- C#如何抓取网页数据、分析并且去除Html标签
- EditBox Control and font size
- sql 去除html标签函数
- js去除字符串中所有html标签及 符号
- Java去除掉HTML里面所有标签,
- 去除<a>标签虚影的一种方法
- 网易webapp 通过js计算html的font-size
- 取消a标签在移动端点击时的背景颜色 && 去除ios手机端input输入框上方有阴影
- 谷歌chrome浏览器下font-size属性值小于12px时无效问题的解决办法
- input标签的size和maxlength属性探究