We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 643d5ec + 1450070 commit 58f66a1Copy full SHA for 58f66a1
src/preprocess/links.rs
@@ -335,16 +335,19 @@ impl<'a> Link<'a> {
335
LinkType::Playground(ref pat, ref attrs) => {
336
let target = base.join(pat);
337
338
- let contents = fs::read_to_string(&target).with_context(|| {
+ let mut contents = fs::read_to_string(&target).with_context(|| {
339
format!(
340
"Could not read file for link {} ({})",
341
self.link_text,
342
target.display()
343
)
344
})?;
345
let ftype = if !attrs.is_empty() { "rust," } else { "rust" };
346
+ if !contents.ends_with('\n') {
347
+ contents.push('\n');
348
+ }
349
Ok(format!(
- "```{}{}\n{}\n```\n",
350
+ "```{}{}\n{}```\n",
351
ftype,
352
attrs.join(","),
353
contents
0 commit comments