util::word_diff (public)

 util::word_diff -old old -new new [ -split_by split_by ] \
    [ -filter_proc filter_proc ] [ -start_old start_old ] \
    [ -end_old end_old ] [ -start_new start_new ] [ -end_new end_new ]

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Does a word (or character) diff on two lines of text and indicates text that has been deleted/changed or added by enclosing it in start/end_old/new.

Switches:
-old
(required)
The original text.
-new
(required)
The modified text.
-split_by
(optional)
If split_by is a space, the diff will be made on a word-by-word basis. If it is the empty string, it will be made on a char-by-char basis.
-filter_proc
(defaults to "ns_quotehtml") (optional)
A filter to run the old/new text through before doing the diff and inserting the HTML fragments below. Keep in mind that if the input text is HTML, and the start_old, etc... fragments are inserted at arbitrary locations depending on where the diffs are, you might end up with invalid HTML unless the original HTML is quoted.
-start_old
(defaults to "<strike><i><font color="blue">") (optional)
HTML fragment to place before text that has been removed.
-end_old
(defaults to "</font></i></strike>") (optional)
HTML fragment to place after text that has been removed.
-start_new
(defaults to "<u><b><font color="red">") (optional)
HTML fragment to place before new text.
-end_new
(defaults to "</font></b></u>") (optional)
HTML fragment to place after new text.
Author:
Gabriel Burca
See Also:
  • ns_quotehtml

Partial Call Graph (max 5 caller/called nodes):
%3 test_word_diff word_diff (test acs-tcl) util::word_diff util::word_diff test_word_diff->util::word_diff ad_tmpdir ad_tmpdir (public) util::word_diff->ad_tmpdir

Testcases:
word_diff
[ show source ]
Show another procedure: