Triage

object Triage(source)

Properties

Link copied to clipboard
const val MAX_BODY: Int
Link copied to clipboard
const val MAX_LINE: Int = 4096

Functions

Link copied to clipboard
fun clean(text: String): String

Line endings become \n, secrets are masked by Redactor, other users' home paths by Anonymizer, and an @login mention becomes @ plus hashUser. A mention inside a fenced code block stays, since it is usually an annotation. Overlong lines are cut at MAX_LINE. Spans in a result refer to this text.

Link copied to clipboard
fun hashUser(login: String): String

The stored form of a login: u and ten hex digits of the SHA-256 of the lowercase name.

Link copied to clipboard
fun run(text: String, options: TriageOptions = TriageOptions(), rules: List<Rule> = Rules.all, known: List<Fact> = emptyList()): TriageResult

Reads text against rules and returns the facts, rule matches, claims and draft. known are facts the reader has since checked on the failing machine; they replace the same key and side found in the text.