1.0.1 • Published 1 year ago

rich-text-compare v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Installation

 npm install rich-text-compare

#Examples

import compare from "rich-text-compare"
const oldStr = `<p>hello</p>`
const newStr = `<p>hello1</p>`
const diffStr = compare(newStr,oldStr,{
    // 删除文本样式
    deleteTextStyle:`;color: red; text-decoration: line-through;background-color: #F59A23;`,
    // 添加文本样式
    addTextStyle:`;color: green;background-color: #95F204;`,
    // 文本格式修改样式
    styleChanged:`;background-color: #8080FF;display: inline-block`
})

// diffStr = `<p>hello<span style='color: green;background-color: #95F204;'>1</span><p>`
1.0.1

1 year ago

1.0.0

1 year ago