/** * Making README text safe and readable before it is rendered. * * Two jobs: deciding which URLs may reach the DOM, and reducing the HTML that * READMEs are full of down to Markdown the renderer understands. * * This lives outside `src/client` on purpose. It is compiled into both tsc * programs — the browser half imports it, and the host build emits it to * `lib/` — which is what lets the offline smoke checks exercise it directly. * A security boundary that cannot be tested is a security boundary nobody * knows the state of. * * Like `types.ts`, it must stay import-free so neither program drags the * other's `Context` declaration merge in behind it. */ /** * Inline Markdown constructs, matched in priority order within one pass. * * Order is load-bearing. The linked-image alternative must come before the * plain link: nearly every README opens with a row of badges written as * `[](target)`, and the plain-link pattern matches a prefix of * that — taking `` stranded as literal text in the output. * * Lives here rather than beside the renderer so the ordering can be asserted * without standing up React. */ export declare const INLINE: RegExp; /** * Resolve a possibly-relative URL, refusing anything that is not http(s). * * React escapes text content but does not vet URL attributes: it will pass * `javascript:alert(1)` to an `href` unchanged. README text comes from * strangers' repositories, so every URL is filtered here before it reaches * the DOM. Schemes are checked after resolution as well as before, because a * relative-looking string can still resolve somewhere unexpected. * @param raw - the URL as written in the document. * @param baseUrl - the document's own location, when known. * @returns an absolute http(s) URL, or undefined when unusable. */ export declare function safeUrl(raw: string, baseUrl?: string): string | undefined; /** * Reduce the HTML in a README to Markdown. * * READMEs routinely open with a centred `