3 # Converts the last NEWS entry to GitHub format
9 # Merge continuation lines (starting with 6+ spaces) into the previous line.
10 # Implementation is a bit convoluted, but heres the gist of it:
11 # hold the current line...
13 # ...read next one (potential continuation)
15 # if its a continuation line...
17 # swap back the non-continuation line
19 # ...so to append the continuation
21 # replace the newline + spaces with a single space
23 # and check next line again
26 # not a continuation line, restore the current and hold the next
29 # stop at the second header
31 # strip the leading indentation
34 s/^[A-Za-z0-9_-]/## \0/
35 # Turn PR and Issue references to links
36 s%PR#\([0-9]\{1,\}\)%[\0](https://github.com/geany/geany/pull/\1)%g
37 s%Issue#\([0-9]\{1,\}\)%[\0](https://github.com/geany/geany/issues/\1)%g
41 # restore the non-continuation line we peeked at, and start next cycle