Skip to content

Commit 9706c89

Browse files
committed
---
yaml --- r: 175271 b: refs/heads/master c: 2b11a80 h: refs/heads/master i: 175269: 9075bd9 175267: 64c591a 175263: 66fc576 v: v3
1 parent b7c5655 commit 9706c89

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 17ebb6053edd7b7d6e8ab5f59dd093f53db7ae44
2+
refs/heads/master: 2b11a80a60dbae980418b229ab89d2a28dbbc15f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 777435990e0e91df6b72ce80c9b6fa485eeb5daa
55
refs/heads/try: 08f6380a9f0b866796080094f44fe25ea5636547

trunk/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
{

trunk/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)