summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-02 19:56:19 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-03 17:36:20 -0700
commit15856139e4e1ebbbf0a2a2d90996dff7d837cdd7 (patch)
tree378024d3074be0557911133c4cff553e13e9f344 /src/librustdoc/html
parent9306e840f59ac22651c6177a89352bf5d607fcbd (diff)
downloadrust-15856139e4e1ebbbf0a2a2d90996dff7d837cdd7.tar.gz
rust-15856139e4e1ebbbf0a2a2d90996dff7d837cdd7.zip
rustdoc: Enable the footnote markdown extension
This enables hoedown's footnote extension, and fixes all footnotes in the
reference manual to use the new syntax.
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/markdown.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 432f089cf42..9d6b0ec5517 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -51,6 +51,14 @@ static HOEDOWN_EXT_TABLES: libc::c_uint = 1 << 0;
 static HOEDOWN_EXT_FENCED_CODE: libc::c_uint = 1 << 1;
 static HOEDOWN_EXT_AUTOLINK: libc::c_uint = 1 << 3;
 static HOEDOWN_EXT_STRIKETHROUGH: libc::c_uint = 1 << 4;
+static HOEDOWN_EXT_SUPERSCRIPT: libc::c_uint = 1 << 8;
+static HOEDOWN_EXT_FOOTNOTES: libc::c_uint = 1 << 2;
+
+static HOEDOWN_EXTENSIONS: libc::c_uint =
+    HOEDOWN_EXT_NO_INTRA_EMPHASIS | HOEDOWN_EXT_TABLES |
+    HOEDOWN_EXT_FENCED_CODE | HOEDOWN_EXT_AUTOLINK |
+    HOEDOWN_EXT_STRIKETHROUGH | HOEDOWN_EXT_SUPERSCRIPT |
+    HOEDOWN_EXT_FOOTNOTES;
 
 type hoedown_document = libc::c_void;  // this is opaque to us
 
@@ -236,9 +244,6 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
 
     unsafe {
         let ob = hoedown_buffer_new(DEF_OUNIT);
-        let extensions = HOEDOWN_EXT_NO_INTRA_EMPHASIS | HOEDOWN_EXT_TABLES |
-                         HOEDOWN_EXT_FENCED_CODE | HOEDOWN_EXT_AUTOLINK |
-                         HOEDOWN_EXT_STRIKETHROUGH;
         let renderer = hoedown_html_renderer_new(0, 0);
         let mut opaque = MyOpaque {
             dfltblk: (*renderer).blockcode.unwrap(),
@@ -248,7 +253,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
         (*renderer).blockcode = Some(block);
         (*renderer).header = Some(header);
 
-        let document = hoedown_document_new(renderer, extensions, 16);
+        let document = hoedown_document_new(renderer, HOEDOWN_EXTENSIONS, 16);
         hoedown_document_render(document, ob, s.as_ptr(),
                                 s.len() as libc::size_t);
         hoedown_document_free(document);
@@ -319,15 +324,12 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
 
     unsafe {
         let ob = hoedown_buffer_new(DEF_OUNIT);
-        let extensions = HOEDOWN_EXT_NO_INTRA_EMPHASIS | HOEDOWN_EXT_TABLES |
-                         HOEDOWN_EXT_FENCED_CODE | HOEDOWN_EXT_AUTOLINK |
-                         HOEDOWN_EXT_STRIKETHROUGH;
         let renderer = hoedown_html_renderer_new(0, 0);
         (*renderer).blockcode = Some(block);
         (*renderer).header = Some(header);
         (*(*renderer).opaque).opaque = tests as *mut _ as *mut libc::c_void;
 
-        let document = hoedown_document_new(renderer, extensions, 16);
+        let document = hoedown_document_new(renderer, HOEDOWN_EXTENSIONS, 16);
         hoedown_document_render(document, ob, doc.as_ptr(),
                                 doc.len() as libc::size_t);
         hoedown_document_free(document);