From 2aaf3d21064af85ae0eaf4f061de1e82d71e13b4 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 29 Oct 2024 20:58:49 +0100 Subject: [PATCH] dedent transform --- texttools.tcl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/texttools.tcl b/texttools.tcl index abc1efc..57d8aa0 100755 --- a/texttools.tcl +++ b/texttools.tcl @@ -1,5 +1,7 @@ #!/usr/bin/env wish +package require textutil + set active_transform 0 proc oneline {text} { @@ -17,6 +19,10 @@ proc wordcount {text} { return $out } +proc dedent {text} { + return [textutil::undent $text] +} + proc markdown_quote {text} { set text [string trimright $text] return [string cat "> " [regsub -all \n $text "\n> "]] @@ -24,6 +30,7 @@ proc markdown_quote {text} { lappend transforms [list {One line} oneline] lappend transforms [list {Line/Word/Char} wordcount] +lappend transforms [list {Dedent} dedent] lappend transforms [list {Markdown Quote} markdown_quote] wm geometry . 750x650