| | |
| | | // info 是需要提示的内容 |
| | | self.$messagewarn(info) |
| | | } |
| | | // 过滤word复制 |
| | | this.editor.customConfig.pasteTextHandle = function(content) { |
| | | var html = content |
| | | html = html.replace(/<\/?SPANYES[^>]*>/gi, '')// 移除span |
| | | html = html.replace(/<\!\-\-(.|[\r\n])*?\-\->/gi, '')// 移除注释 |
| | | html = html.replace(/<(\w[^>]*) {2}lang=([^|>]*)([^>]*)/gi, '<$1$3')// 移除lang属性 |
| | | html = html.replace(/<\\?\?xml[^>]*>/gi, '')// 移除xml和相关描述 |
| | | html = html.replace(/<\/?\w+:[^>]*>/gi, '')// 移除xml命名空间的标签 |
| | | html = html.replace(/ /gi, '')// 移除空格 |
| | | html = html.replace(/^\s+|\s+$/g, '') |
| | | html = html.replace(/<o:p> <\/o:p>/g, '')// 移除标签 |
| | | html = html.replace(/<br\/>/g, '')// 移除br标签 |
| | | return html |
| | | } |
| | | this.editor.create() // 创建富文本实例 |
| | | // if (!this.content) { |
| | | // // this.editor.txt.html('请编辑内容1') |