Documentation
¶
Overview ¶
Package markdown writes the placeholders a mask.Masker puts in place of hidden values so that Markdown shows them, for an action that posts text with them, such as the notes of a run, where <secret:NAME> and <redacted> would be taken for something else: an HTML tag on GitHub, which leaves it out, or a link or a mention on Slack.
It is a package of its own, apart from mask, which every action links through actionrpc, so that only an action that writes Markdown carries the Markdown parser it reads the text with.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Escape ¶
Escape returns s, a Markdown text such as the body of a note, with each placeholder outside code written as style says, so that a reader sees where a value was hidden. A placeholder in a code block or a code span is shown as it is, so it is left alone there. The code of s is found as a CommonMark parser finds it, with its blocks, quotes, lists and headings, and the tables of GitHub Flavored Markdown.
A backslash right before a placeholder is escaped, so that it does not escape what is written in its place. With AsEntity, what the placeholder names is written as text, so that a & or a * in the name of a secret is not read as an entity or as emphasis. With AsCode, a placeholder is put in a span of a number of backticks no run of s has, so that no backtick left unmatched before it can close the span, and it is kept apart by a space from a backtick or another placeholder right next to it, whose backticks would make one run with those of its span. In a table row, a | of the name is escaped too, so that it does not end the cell.