Skip to content

[Fix] Remove extra-line in MD Link HTML template #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ai_pocket_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl<'a> MDLink<'a> {

// register template
handlebars
.register_template_string("md_link_expansion", MDLINK_TEMPLATE)
.register_template_string("md_link_expansion", MDLINK_TEMPLATE.trim())
.unwrap();

// create data for rendering handlebar
Expand Down Expand Up @@ -555,7 +555,7 @@ mod tests {

let html_string = link.render()?;
let expected = "<a href=\"https://fake.io\" target=\"_blank\" \
rel=\"noopener noreferrer\">some text</a>\n";
rel=\"noopener noreferrer\">some text</a>";

assert_eq!(html_string, expected);

Expand All @@ -570,7 +570,7 @@ mod tests {

let new_content = replace_all_md_links(content);
let expected = "This is <a href=\"https://good.io\" target=\"_blank\" \
rel=\"noopener noreferrer\">good link</a>\n, whereas ![this](https://not-covered.io), \
rel=\"noopener noreferrer\">good link</a>, whereas ![this](https://not-covered.io), \
and neither is \\[this\\](http://not-covered.io).";

assert_eq!(new_content, expected);
Expand Down