Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 19 Oct 2023 21:02:51 UTC Commit: 0fd68e4182bf2540249810da52382e2f1c4810aa https://github.com/geany/geany/commit/0fd68e4182bf2540249810da52382e2f1c4810...
Log Message: ----------- scripts/github-news: Handle continuation lines
Merge continuation lines with the previous line not to get spurious line breaks.
Modified Paths: -------------- scripts/github-news
Modified: scripts/github-news 24 lines changed, 23 insertions(+), 1 deletions(-) =================================================================== @@ -6,6 +6,26 @@ sed -n -e ' n :next
+# Merge continuation lines (starting with 6+ spaces) into the previous line. +# Implementation is a bit convoluted, but heres the gist of it: +# hold the current line... +h +# ...read next one (potential continuation) +n +# if its a continuation line... +/^ {6,}/{ + # swap back the non-continuation line + x + # ...so to append the continuation + G + # replace the newline + spaces with a single space + s/\n */ / + # and check next line again + b next +} +# not a continuation line, restore the current and hold the next +x + # stop at the second header /^[A-Za-z0-9_-]/q # strip the leading indentation @@ -17,6 +37,8 @@ s%PR#([0-9]{1,})%[\0](https://github.com/geany/geany/pull/%5C1)%g s%Issue#([0-9]{1,})%[\0](https://github.com/geany/geany/issues/%5C1)%g
p -n + +# restore the non-continuation line we peeked at, and start next cycle +x b next ' < NEWS
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).