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 (optional, defaults to "ns_quotehtml")
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 (optional, defaults to "<strike><i><font color="blue">")
HTML fragment to place before text that has been removed.
-end_old (optional, defaults to "</font></i></strike>")
HTML fragment to place after text that has been removed.
-start_new (optional, defaults to "<u><b><font color="red">")
HTML fragment to place before new text.
-end_new (optional, defaults to "</font></b></u>")
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 util::which util::which (public) util::word_diff->util::which

Testcases:
word_diff
[ show source ]
Show another procedure: