Skip to content

Commit 7280577

Browse files
committed
---
yaml --- r: 176767 b: refs/heads/tmp c: 2b11a80 h: refs/heads/master i: 176765: 9632e8a 176763: 2cb7eb9 176759: cc4b9a1 176751: 1a571f2 176735: fb92170 176703: def463f 176639: 81fa5a8 v: v3
1 parent 52fa088 commit 7280577

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 17ebb6053edd7b7d6e8ab5f59dd093f53db7ae44
37+
refs/heads/tmp: 2b11a80a60dbae980418b229ab89d2a28dbbc15f

branches/tmp/src/librustdoc/html/markdown.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,14 @@ impl<'a> fmt::String for MarkdownWithToc<'a> {
471471
}
472472

473473
pub fn plain_summary_line(md: &str) -> String {
474-
extern "C" fn link(_ob: *mut hoedown_buffer,
474+
extern fn link(_ob: *mut hoedown_buffer,
475475
_link: *const hoedown_buffer,
476476
_title: *const hoedown_buffer,
477477
content: *const hoedown_buffer,
478478
opaque: *mut libc::c_void) -> libc::c_int
479479
{
480480
unsafe {
481481
if !content.is_null() && (*content).size > 0 {
482-
// FIXME(liigo): I don't know why the parameter `_ob` is
483-
// not the value passed in by `hoedown_document_render`.
484-
// I have to manually pass in `ob` through `opaque` currently.
485482
let ob = opaque as *mut hoedown_buffer;
486483
hoedown_buffer_put(ob, (*content).data as *const libc::c_char,
487484
(*content).size);
@@ -490,7 +487,7 @@ pub fn plain_summary_line(md: &str) -> String {
490487
1
491488
}
492489

493-
extern "C" fn normal_text(_ob: *mut hoedown_buffer,
490+
extern fn normal_text(_ob: *mut hoedown_buffer,
494491
text: *const hoedown_buffer,
495492
opaque: *mut libc::c_void)
496493
{

branches/tmp/src/librustdoc/html/render.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ use html::item_type::ItemType;
6464
use html::layout;
6565
use html::markdown::Markdown;
6666
use html::markdown;
67+
use html::escape::Escape;
6768
use stability_summary;
6869

6970
/// A pair of name and its optional document.
@@ -2197,21 +2198,6 @@ fn item_typedef(w: &mut fmt::Formatter, it: &clean::Item,
21972198
document(w, it)
21982199
}
21992200

2200-
fn escape_title(title: &str) -> String {
2201-
let title = markdown::plain_summary_line(title);
2202-
let mut result = String::with_capacity(title.len());
2203-
for c in title.chars() {
2204-
match c {
2205-
'<' => result.push_str("&lt;"),
2206-
'>' => result.push_str("&gt;"),
2207-
'"' => result.push_str("&quot;"),
2208-
'\'' => result.push_str("&#39;"),
2209-
_ => result.push(c),
2210-
}
2211-
}
2212-
result
2213-
}
2214-
22152201
impl<'a> fmt::String for Sidebar<'a> {
22162202
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
22172203
let cx = self.cx;
@@ -2251,7 +2237,7 @@ impl<'a> fmt::String for Sidebar<'a> {
22512237
} else {
22522238
format!("{}.{}.html", short, name.as_slice())
22532239
},
2254-
title = escape_title(doc.as_ref().unwrap().as_slice()),
2240+
title = Escape(doc.as_ref().unwrap().as_slice()),
22552241
name = name.as_slice()));
22562242
}
22572243
try!(write!(w, "</div>"));

0 commit comments

Comments
 (0)