Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't diff embed bolt #92

Open
looping67 opened this issue Jul 20, 2023 · 0 comments
Open

can't diff embed bolt #92

looping67 opened this issue Jul 20, 2023 · 0 comments

Comments

@looping67
Copy link

looping67 commented Jul 20, 2023

const beforeA = {"ops":[{"insert":"新"},{"insert":{"DuoYinEmbed":{"character":"鲜","pinyinList":["xian1","xian3"]}}},{"insert":{"DuoYinEmbed":{"character":"的","pinyinList":["de5","di4","di2"]}}}]}

 const afterA = {"ops":[{"insert":"新"},{"insert":{"PreEmbed":{"text":"鲜","tagTxt":"xian1","ssml":{"tag":"phoneme","prop":"ph","value":"xian1"},"curBtnKey":"duoyin","ssmlValue":"xian1"}}},{"insert":{"DuoYinEmbed":{"character":"鲜","pinyinList":["xian1","xian3"]}}},{"insert":{"EndTagEmbed":{"curBtnKey":"duoyin"}}}]}

Object.stringify(new Delta(afterA).diff(new Delta(beforeA))

// output==>
{"ops":[{"retain":1},{"insert":{"DuoYinEmbed":{"character":"鲜","pinyinList":["xian1","xian3"]}}},{"insert":{"DuoYinEmbed":{"character":"的","pinyinList":["de5","di4","di2"]}}},{"delete":3}]}

there is no PreEmbed and endTagEmbed 。is it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant