Skip to content

Commit 14e6b3e

Browse files
committed
Minimal documentation
1 parent 59e92ad commit 14e6b3e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

app/routes/crate/version.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export default Route.extend({
108108
method: 'GET',
109109
dataType: 'html',
110110
headers: {
111+
// We need to force the Accept header, otherwise crates.io won't return
112+
// the readme file when not using S3.
111113
Accept: '*/*',
112114
},
113115
}))

src/render.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use pulldown_cmark::html;
44

55
use util::CargoResult;
66

7+
/// Renders a markdown text to sanitized HTML. The returned text should not contain any harmful
8+
/// HTML tag or attribute (such as iframe, onclick, onmouseover, etc.).
79
pub fn markdown_to_html(text: &str) -> CargoResult<String> {
810
let mut rendered = String::with_capacity(text.len() * 3 / 2);
911
let cleaner = Ammonia {

0 commit comments

Comments
 (0)