markdown

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BitbucketToSlackEmojiTwoWay = map[string]string{
		":frame_photo:": ":frame_with_picture:",
		":robot:":       ":robot_face:",

		":rofl:":         ":rolling_on_the_floor_laughing:",
		":slight_frown:": ":slightly_frowning_face:",
		":slight_smile:": ":slightly_smiling_face:",
		":upside_down:":  ":upside_down_face:",

		":man_facepalming:":  ":man-facepalming:",
		":man_gesturing_no:": ":man-gesturing-no:",
		":man_gesturing_ok:": ":man-gesturing-ok:",
		":man_shrugging:":    ":man-shrugging:",

		":woman_facepalming:":  ":woman-facepalming:",
		":woman_gesturing_no:": ":woman-gesturing-no:",
		":woman_gesturing_ok:": ":woman-gesturing-ok:",
		":woman_shrugging:":    ":woman-shrugging:",

		":person_bald:": ":bald_person:",
	}

	SlackToBitbucketEmojiOneWay = map[string]string{
		":face_palm:": ":man_facepalming:",
		":memo:":      ":pencil:",
		":no_good:":   ":man_gesturing_no:",
		":ok_woman:":  ":woman_gesturing_ok:",
		":shrug:":     ":man_shrugging:",
		":thanks:":    ":pray:",
	}

	// GitHubToSlackEmojiTwoWay is based on: https://api.github.com/emojis
	GitHubToSlackEmojiTwoWay = map[string]string{
		":framed_picture:": ":frame_with_picture:",
		":robot:":          ":robot_face:",

		":rofl:": ":rolling_on_the_floor_laughing:",

		":man_facepalming:": ":man-facepalming:",
		":no_good_man:":     ":man-gesturing-no:",
		":ok_man:":          ":man-gesturing-ok:",
		":man_shrugging:":   ":man-shrugging:",

		":woman_facepalming:": ":woman-facepalming:",
		":no_good_woman:":     ":woman-gesturing-no:",

		":woman_shrugging:": ":woman-shrugging:",

		":person_bald:": ":bald_person:",
		":facepalm:":    ":face_palm:",
	}

	// SlackToGitHubEmojiOneWay is based on: https://api.github.com/emojis
	SlackToGitHubEmojiOneWay = map[string]string{
		":thanks:": ":pray:",
	}

	SlackSkinTonePattern = regexp.MustCompile(`:skin-tone-\d:`)
)

Functions

func BitbucketToSlackEmoji added in v1.7.2

func BitbucketToSlackEmoji(text string) string

BitbucketToSlackEmoji fixes small inconsistencies in emoji names between Bitbucket and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of SlackToBitbucketEmoji.

func GitHubToSlackEmoji added in v1.7.2

func GitHubToSlackEmoji(text string) string

GitHubToSlackEmoji fixes small inconsistencies in emoji names between GitHub and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of SlackToGitHubEmoji.

func LinkifyTitle added in v1.1.0

func LinkifyTitle(ctx workflow.Context, cfg map[string]string, prURL, title string) string

LinkifyTitle finds IDs in the given title of a pull/merge request and tries to replace them with Slack links: in the same repository, a nearby one, or based on RevChat's configuration of issue trackers. If no IDs are found, or none are recognized, it returns the input text unchanged.

func ShortenSlackURLs added in v1.7.2

func ShortenSlackURLs(commentURL, text string) string

ShortenSlackURLs ensures that updates of Slack messages won't fail due to a "msg_too_long" error (API limit: text length <= 4000 characters). When the text approaches this limit, we look for long URLs (512+ characters) that are masked by a label, and replace them with the PR comment's URL, so they're still accessible with an extra click but don't take up so much space in the message itself.

func SlackToBitbucketEmoji added in v1.7.2

func SlackToBitbucketEmoji(text string) string

SlackToBitbucketEmoji fixes small inconsistencies in emoji names between Bitbucket and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of BitbucketToSlackEmoji. Note that some emojis are supported in Slack but not in Bitbucket, so we adjust them to the closest equivalent.

func SlackToGitHubEmoji added in v1.7.2

func SlackToGitHubEmoji(text string) string

SlackToGitHubEmoji fixes small inconsistencies in emoji names between GitHub and Slack. It doesn't address all of them yet, but eventually it should. It is idempotent, and the inverse of GitHubToSlackEmoji. Note that some emojis are supported in Slack but not in GitHub, so we adjust them to the closest equivalent.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL