Find image URLs in a message body, returning an array of Slack message attachments, one for each image. It expects the message to be in Slack message markup.
message body
array of Slack message Attachments with the image_url
set
to the URL of the image and the text
and fallback
set
to the image name.
Find all issue mentions and return an array of unique issue mentions as "#3" and "owner/repo#5".
string that may contain mentions
unique list of issue mentions as #N or O/R#N
Find issue mentions in body and replace them with links.
message to modify
repository information
string with issue mentions replaced with links
Generate GitHub repository "slug", i.e., owner/repo.
repository with .owner and .name
owner/name string
Safely truncate the first line of a commit message to 50 characters or less. Only count printable characters, i.e., not link URLs or markup.
If the URL is of an image, return a Slack message attachment that will render that image. Otherwise return null.
full URL
Slack message attachment for image or null
Generated using TypeDoc
Regular expression to find issue mentions. There are capture groups for the issue repository owner, repository name, and issue number. The capture groups for repository owner and name are optional and therefore may be null, although if one is set, the other should be as well.
The rules for preceding characters is different for current repo matches, e.g., "#43", and other repo matches, e.g., "some/repo#44". Current repo matches allow anything but word characters to precede them. Other repo matches only allow a few other characters to preceed them.