Test Cases

data-diff-key

should return the same HTML element if no changes are made

Before

|
Loading...

After

|
Loading...

Diff Result

|

should highlight added element

Before

|
Loading...

After

|
Loading...

Diff Result

|

should mark changed element as modified without data-diff-mode

Before

|
Loading...

After

|
Loading...

Diff Result

|

should preserve escaped attribute values when text changes

Before

|
Loading...

After

|
Loading...

Diff Result

|

data-diff-mode='element'

should use atomic element diffing when data-diff-mode="element" is specified

Before

|
Loading...

After

|
Loading...

Diff Result

|

should not duplicate identical element-mode nodes

Before

|
Loading...

After

|
Loading...

Diff Result

|

should handle element diffing with existing classes

Before

|
Loading...

After

|
Loading...

Diff Result

|

data-diff-mode='words'

should highlight added text within a paragraph

Before

|
Loading...

After

|
Loading...

Diff Result

|

should keep escaped text when doing word-level diffing

Before

|
Loading...

After

|
Loading...

Diff Result

|

should highlight removed text within a paragraph

Before

|
Loading...

After

|
Loading...

Diff Result

|

should handle text changes with both additions and removals

Before

|
Loading...

After

|
Loading...

Diff Result

|

should merge diff classes with existing classes

Before

|
Loading...

After

|
Loading...

Diff Result

|

data-diff-show-when-removed

should insert removed element when it has data-diff-show-when-removed

Before

|
Loading...

After

|
Loading...

Diff Result

|

should NOT insert removed element when it lacks data-diff-show-when-removed

Before

|
Loading...

After

|
Loading...

Diff Result

|

should handle mixed scenarios - some elements show when removed, others don't

Before

|
Loading...

After

|
Loading...

Diff Result

|

should preserve escaped text when re-inserting removed elements

Before

|
Loading...

After

|
Loading...

Diff Result

|