Add tests for automatically slugged links
This commit is contained in:
parent
575c18f915
commit
cffcc93b15
1 changed files with 19 additions and 0 deletions
|
@ -41,3 +41,22 @@ pub fn render_markdown_for_fts(src: &str) -> String {
|
||||||
|
|
||||||
buf
|
buf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn slug_link() {
|
||||||
|
let actual = render_markdown("[Slug link]");
|
||||||
|
let expected = "<p><a href=\"slug-link\" title=\"Slug link\">Slug link</a></p>\n";
|
||||||
|
assert_eq!(actual, expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn footnote_links() {
|
||||||
|
let actual = render_markdown("[Link]\n\n[Link]: target");
|
||||||
|
let expected = "<p><a href=\"target\">Link</a></p>\n";
|
||||||
|
assert_eq!(actual, expected);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue