import rehypeStringify from "rehype-stringify"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; import rehypeParse from "rehype-parse"; import { unified } from "unified"; import rehypeSemanticBlockquotes from "./index.ts"; import test from "node:test"; import assert from "node:assert"; const markdownTests = [ [ "Do nothing if there is no linebreak between the credit and the content", `> Better to admit you walked through the wrong door than spend your life in the wrong room. > @ Josh Davis `, `
`, ], [ "Does not transform markdown link", `> Better to admit you walked through the wrong door than spend your life in the wrong room. > > @ [Josh Davis](https://somewhere.com) `, `Better to admit you walked through the wrong door than spend your life in the wrong room. @ Josh Davis
Better to admit you walked through the wrong door than spend your life in the wrong room.
Better to admit you walked through the wrong door than spend your life in the wrong room.
Credit: Josh Davis, we obtained the quote at some website
Better to admit you walked through the wrong door than spend your life in the wrong room.
Josh Davis
Here are some steps:
- Do this
- Then do that
- Finally, do the other thing
Jane Doe
Use the
console.log()function to debug your code.
John Doe
`, `Simple quote.
@ Author Name
Simple quote.
Author Name
`, `Minified quote.
@ Author
Minified quote.
Author
`, `Quote with emphasis and strong.
@ Author
Quote with emphasis and strong.
Author
`, `@ Not at the end.
This should not transform.
` ], [ "Handles multiple paragraphs in blockquote", `@ Not at the end.
This should not transform.
`, `First paragraph.
Second paragraph.
@ Author
First paragraph.
Second paragraph.
Author
`, `Quote.
@ Author with spaces
Quote.
Author with spaces