diff --git a/content/tokio/topics/testing.md b/content/tokio/topics/testing.md index b04948c6..c58b39c4 100644 --- a/content/tokio/topics/testing.md +++ b/content/tokio/topics/testing.md @@ -166,7 +166,7 @@ be used as a mock: # line.clear(); # } # } - +# #[tokio::test] async fn client_handler_replies_politely() { let reader = tokio_test::io::Builder::new() diff --git a/lib/markdown.js b/lib/markdown.js index 3142ca4a..4387c99a 100644 --- a/lib/markdown.js +++ b/lib/markdown.js @@ -18,7 +18,19 @@ const remarkCodeRemoveSomeLines = () => { if (node.lang && langs.includes(node.lang)) { node.value = node.value .split("\n") - .filter((line) => !line.startsWith("# ")) + .map((line) => { + let trimmed = line.trim(); + if (trimmed.startsWith("##")) { + return line.replace("##", "#"); + } else if (trimmed.startsWith("# ")) { + return null; + } else if (trimmed === "#") { + return null; + } else { + return line; + } + }) + .filter((line) => line !== null) .join("\n"); } });