File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ lv_modified = '\n'
6868REPLACE ALL OCCURRENCES OF '\n' IN lv_original WITH cl_abap_char_utilities=>newline.
6969REPLACE ALL OCCURRENCES OF '\n' IN lv_modified WITH cl_abap_char_utilities=>newline.
7070
71- CREATE OBJECT li_htmldiff TYPE zcl_htmldiff.
71+ li_htmldiff = zcl_htmldiff=>create( ) .
7272
7373lv_diff = li_htmldiff->htmldiff(
7474 iv_before = lv_original
@@ -111,7 +111,7 @@ Result:
111111 <span >This is some <del >interesting</del ><ins >new</ins > text.</span >
112112```
113113
114- There are a few other options you can set in the ` constructor ` :
114+ There are a few other options you can set in the ` constructor ` / ` create ` statement :
115115
116116- ` iv_inserts ` : Show ` <ins> ` tags (default: on)
117117- ` iv_deletes ` : Show ` <del> ` tags (default: on)
@@ -124,15 +124,31 @@ See the [test classes](https://github.com/Marc-Bernard-Tools/ABAP-HTML-Diff/blob
124124
125125### Diffing Text
126126
127- todo
127+ The following produces the diff of two example text snippets:
128128
129129``` abap
130+ DATA:
131+ lv_original TYPE string,
132+ lv_modified TYPE string,
133+ lv_diff TYPE string,
134+ li_htmldiff TYPE REF TO zif_htmldiff.
135+
136+ lv_original = 'a c'.
137+
138+ lv_modified = 'a b c'.
139+
130140lv_diff = li_htmldiff->textdiff(
131141 iv_before = lv_original
132142 iv_after = lv_modified ).
133143```
134144
135- ** Styling**
145+ Result:
146+
147+ ``` text
148+ a <ins>b </ins>c
149+ ```
150+
151+ ### Styling
136152
137153Here's an examle for styling the insertions and deletions using CSS.
138154
You can’t perform that action at this time.
0 commit comments