style: improve codespan styling and checkbox markers

This commit is contained in:
mitchell 2026-05-01 21:23:21 -04:00
parent 7b730631b2
commit 94895aacd5
2 changed files with 3 additions and 3 deletions

View file

@ -77,7 +77,7 @@ export async function renderMarkdown(
const indent = " ".repeat(depth); const indent = " ".repeat(depth);
let marker = ""; let marker = "";
if (checked !== undefined) { if (checked !== undefined) {
marker = checked ? "[✓]" : "[ ]"; marker = checked ? "[✓]" : "[ ]";
} else if (ordered) { } else if (ordered) {
const n = (start ?? 1) + index; const n = (start ?? 1) + index;
marker = `${n}.`; marker = `${n}.`;
@ -104,7 +104,7 @@ export async function renderMarkdown(
strong: (children) => chalk.bold(children), strong: (children) => chalk.bold(children),
emphasis: (children) => chalk.italic(children), emphasis: (children) => chalk.italic(children),
strikethrough: (children) => chalk.grey.strikethrough(children), strikethrough: (children) => chalk.grey.strikethrough(children),
codespan: (children) => chalk.bgWhite.black(` ${children} `), codespan: (children) => chalk.bgBlack.yellowBright(` ${children} `),
link: (children, { href }) => link: (children, { href }) =>
chalk.blueBright.underline(terminalLink(children, href)), chalk.blueBright.underline(terminalLink(children, href)),
image: () => "", image: () => "",

View file

@ -1,6 +1,6 @@
import { renderMarkdown } from "./src/render/markdown.ts"; import { renderMarkdown } from "./src/render/markdown.ts";
const text = await Bun.file("test.md").text(); const text = await Bun.file("README.md").text();
const [columns] = process.stdout.getWindowSize(); const [columns] = process.stdout.getWindowSize();
process.stdout.write(await renderMarkdown(text, columns)); process.stdout.write(await renderMarkdown(text, columns));