diff options
| author | bors <bors@rust-lang.org> | 2015-08-16 17:17:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-08-16 17:17:43 +0000 |
| commit | e822a18ae7d55cefc332c6598a607cef0554ec77 (patch) | |
| tree | 387deb84cf8dd7b04af487cab5ad8b4dcbb18888 /src | |
| parent | 2f60268f54e6e8dd6313d1898f5d846d3e5332af (diff) | |
| parent | 16ec84b75f4c4f4c20c7b7038587ca02e7f8d5b9 (diff) | |
| download | rust-e822a18ae7d55cefc332c6598a607cef0554ec77.tar.gz rust-e822a18ae7d55cefc332c6598a607cef0554ec77.zip | |
Auto merge of #27858 - rkruppe:rustdoc-codespans, r=alexcrichton
Fixes #24746
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 7388a066f22..dd754e58072 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -74,7 +74,7 @@ type headerfn = extern "C" fn(*mut hoedown_buffer, *const hoedown_buffer, libc::c_int, *mut libc::c_void); type codespanfn = extern "C" fn(*mut hoedown_buffer, *const hoedown_buffer, - *mut libc::c_void); + *mut libc::c_void) -> libc::c_int; type linkfn = extern "C" fn (*mut hoedown_buffer, *const hoedown_buffer, *const hoedown_buffer, *const hoedown_buffer, @@ -317,7 +317,11 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result { reset_headers(); - extern fn codespan(ob: *mut hoedown_buffer, text: *const hoedown_buffer, _: *mut libc::c_void) { + extern fn codespan( + ob: *mut hoedown_buffer, + text: *const hoedown_buffer, + _: *mut libc::c_void, + ) -> libc::c_int { let content = if text.is_null() { "".to_string() } else { @@ -329,6 +333,8 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result { let content = format!("<code>{}</code>", Escape(&content)); let element = CString::new(content).unwrap(); unsafe { hoedown_buffer_puts(ob, element.as_ptr()); } + // Return anything except 0, which would mean "also print the code span verbatim". + 1 } unsafe { |
