/usr/share/tkrat2.2/util/rat_enriched.tcl is in tkrat 1:2.2cvs20100105-true-dfsg-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # rat_enriched --
#
# Insert enriched text into text widget
# Enriched text is defined in rfc1896
# For now we just have a minimal implementation
#
package provide rat_enriched 1.0
namespace eval rat_enriched {
namespace export show
}
# rat_enriched::show --
#
# Insert the given enriched text into teh given text widget.
#
# Arguments:
# w - text widget to insert into
# data - Text to insert
# tag - Tag to put on inserted data
proc rat_enriched::show {w data tag} {
# Replace all '=' by 'EqUaL'
regsub -all = $data EqUaL data
# Convert linenedings as per the rfc
regsub -all "\n" $data {=} data
regsub -all {(^|[^=])=([^=]|$)} $data {\1 \2} data
regsub -all {=(=+)} $data {\1} data
regsub -all {=} $data "\n" data
# Convert <<
regsub -all "<" $data {=} data
regsub -all "==" $data {<} data
# Remove parameters
regsub -all {=param>[^=]*=/param>} $data {} data
# Remove all tokens
regsub -all {=/?[a-zA-Z]+>} $data {} data
# Restore the '='
regsub -all EqUaL $data = data
# Configure text widget
$w tag configure enriched -wrap word
$w insert end $data [list enriched tag]
}
|