dot

packages and services management
Log | Files | Refs | README

commit 0e1c81a41160d93efdb6bcdd5f34bd8ba2b2341d
parent a4cc51e0947870cb896b54ab5ca87ebe477b60af
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 13 Apr 2018 09:57:54 +0200

markup-fmt: adjustment

Diffstat:
Abin/black | 3+++
Mbin/git-drag | 0
Mbin/markup-fmt | 7++++++-
Mbin/tcpcat | 0
Abin/white | 3+++
5 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/bin/black b/bin/black @@ -0,0 +1,3 @@ +#!/bin/sh -ex + +printf '\033[?5l' diff --git a/bin/git-drag b/bin/git-drag diff --git a/bin/markup-fmt b/bin/markup-fmt @@ -8,6 +8,9 @@ function fold(block, prefix) sub(" *$", "", block); gsub(" +", " ", block); gsub("[.!?] ", "& ", block); + if (match(block, "^[0-9.]+ ")) + block = substr(block, RMATCH, RLENGTH - 1) \ + substr(block, RLENGTH + 1); while ((line = substr(block, 1, 80 - len)) != "") { if (length(line) == 80 - len) sub(" +[^ ]*$", "", line); @@ -58,8 +61,9 @@ function subheading(str) paragraph(block, ""); block = ""; print(""); while(match($0, /^\t/)) { + sub(" *$", ""); print; - if (!getline) break; + if (!getline) exit; } } @@ -76,6 +80,7 @@ function subheading(str) paragraph(block, ""); block = ""; print(""); while (match($0, /^\[.*\]:/)) { + sub(" *$", ""); print; if (!getline) exit; } diff --git a/bin/tcpcat b/bin/tcpcat diff --git a/bin/white b/bin/white @@ -0,0 +1,3 @@ +#!/bin/sh -ex + +printf '\033[?5h'