diff options
author | Nick White <git@njw.name> | 2015-05-21 10:16:17 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2015-05-21 10:16:17 +0100 |
commit | 14cd447c1446eaa31505f7e5e8c9ef54ff28e465 (patch) | |
tree | 16cdeacafed97b26462ea6f3ecfcbf0e0c15b674 | |
parent | 33f26d42e274392c060e69cb6e1e02a75a1273e0 (diff) | |
download | tkread-14cd447c1446eaa31505f7e5e8c9ef54ff28e465.tar.bz2 tkread-14cd447c1446eaa31505f7e5e8c9ef54ff28e465.zip |
Don't delete then re-add link alt text, as it removes images that are links
-rwxr-xr-x | tkread | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -187,7 +187,7 @@ proc markup {widget} { set cur [$widget search "](" $cur end] if {$cur == ""} { break } set altend $cur - set srcstart [indexmovechar $cur "+ 1"] + set srcstart [indexmovechar $cur "+ 2"] set cur [$widget search ")" $cur end] if {$cur == ""} { break } set srcend $cur @@ -195,11 +195,10 @@ proc markup {widget} { set alt [$widget get $altstart $altend] set src [$widget get $srcstart $srcend] - $widget delete [indexmovechar $altstart "- 1"] [indexmovechar $srcend "+ 1"] - set insertion [indexmovechar $altstart "- 1"] - $widget insert $insertion $alt + $widget delete $altend [indexmovechar $srcend "+ 1"] + $widget delete [indexmovechar $altstart "- 1"] $altstart - set cur [indexmovechar $insertion "+ [string length $alt]"] + set cur [indexmovechar $altend "- 1"] set cur [$widget search {[} $cur end] } |