diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2026-06-06 12:26:27 -0400 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2026-06-06 12:26:27 -0400 |
| commit | b56c273d8198ae6cee69bbc9fe5a6a61da4074e4 (patch) | |
| tree | f75b89299fe2783354ba0ab7e3ace088fa60245a /lib/bib-canon.awk | |
| parent | 4aec9800fca665713b0eba19f10af927b483332e (diff) | |
| download | bibutils-b56c273d8198ae6cee69bbc9fe5a6a61da4074e4.tar.gz | |
Code cleanup
Diffstat (limited to 'lib/bib-canon.awk')
| -rw-r--r-- | lib/bib-canon.awk | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/bib-canon.awk b/lib/bib-canon.awk index d11e9cb..215e4cc 100644 --- a/lib/bib-canon.awk +++ b/lib/bib-canon.awk @@ -26,3 +26,16 @@ function bib_get(name, j) { return BIB_VAL[j] return "" } + +# render a field value as plain text: strip braces, collapse whitespace +function bib_clean(v) { + gsub(/[{}]/, "", v) + gsub(/[ \t\r\n]+/, " ", v) + return bib_trim(v) +} + +# print a blank line between output records (nothing before the first) +function bib_sep() { + if (BIB_OUT_N++) + print "" +} |