The inject() function in the bunder, which inserts HashURL and RTFNotes, was assuming that there would only be one line in plugindef() that starts with return and one line that starts with end. This is not necessarily true, since a line of text in Notes, for example, could start with either of these. (And the Notes in the script I recently added did!)
This PR changes inject() to get the last matching token. There's still an edge case here if plugindef() does not include a return statement (since it's not technically required) but does have a line starting with return in Notes. But since this repo seems to have an unofficial requirement for a proper plugindef() function with a return, I'm not worried about this.
@rpatters1 Not sure if you wanted to review this.
The
inject()
function in the bunder, which insertsHashURL
andRTFNotes
, was assuming that there would only be one line inplugindef()
that starts withreturn
and one line that starts withend
. This is not necessarily true, since a line of text inNotes
, for example, could start with either of these. (And theNotes
in the script I recently added did!)This PR changes
inject()
to get the last matching token. There's still an edge case here ifplugindef()
does not include areturn
statement (since it's not technically required) but does have a line starting withreturn
inNotes
. But since this repo seems to have an unofficial requirement for a properplugindef()
function with areturn
, I'm not worried about this.