export type Wrapper = [string, string];
/** @summary make Wrapper that starts and ends with `input` */
export function WrapWith(input: string): Wrapper {
return [input, input];
}
/** @summary make Wrapper that starts and ends with XML tags with name `tagName` */
export function WrapTag(tagName: string): Wrapper {
return [`<${tagName}>`, `${tagName}>`];
}
// this type is internal to this file
type WrapType = { [K: string]: Wrapper | WrapType };
export const Wrap = {
/** @prop (input) */
parenthesis: ["(", ")"],
/** @prop [input] */
bracket: ["[", "]"],
/** @prop \{input\} */
brace: ["{", "}"],
/** @prop HTML-specifics */
HTML: {
/** @prop \input\ */
bold: WrapTag("b"),
/** @prop \input\ */
italic: WrapTag("i"),
/** @prop \input\ */
span: WrapTag("span"),
/** @prop \input\ */
ruby: WrapTag("ruby"),
/** @prop \ */
rubyText: WrapTag("rt"),
},
/** @prop \*input\* */
asterisk: WrapWith("*"),
/** @prop \_input\_ */
underscore: WrapWith("_"),
} satisfies WrapType;