Updated pulldown-cmark to version 0.0.5

Version 0.0.5 contains table and footnotes support, both options are now enabled in mdBook.
This commit is contained in:
Mathieu David 2016-01-03 12:02:39 +01:00
parent 5170e6b675
commit d000fc8bac
2 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,7 @@ exclude = [
clap = "~1.5.3" clap = "~1.5.3"
handlebars = "~0.12.0" handlebars = "~0.12.0"
rustc-serialize = "~0.3.16" rustc-serialize = "~0.3.16"
pulldown-cmark = "~0.0.3" pulldown-cmark = "~0.0.5"
# Watch feature # Watch feature

View File

@ -4,7 +4,7 @@ use std::path::{Path, PathBuf, Component};
use std::error::Error; use std::error::Error;
use std::fs::{self, metadata, File}; use std::fs::{self, metadata, File};
use self::pulldown_cmark::{Parser, html}; use self::pulldown_cmark::{Parser, html, Options, OPTION_ENABLE_TABLES, OPTION_ENABLE_FOOTNOTES};
/// This is copied from the rust source code until Path_ Ext stabilizes. /// This is copied from the rust source code until Path_ Ext stabilizes.
/// You can use it, but be aware that it will be removed when those features go to rust stable /// You can use it, but be aware that it will be removed when those features go to rust stable
@ -188,7 +188,12 @@ pub fn copy_files_except_ext(from: &Path, to: &Path, recursive: bool, ext_blackl
pub fn render_markdown(text: &str) -> String { pub fn render_markdown(text: &str) -> String {
let mut s = String::with_capacity(text.len() * 3 / 2); let mut s = String::with_capacity(text.len() * 3 / 2);
let p = Parser::new(&text);
let mut opts = Options::empty();
opts.insert(OPTION_ENABLE_TABLES);
opts.insert(OPTION_ENABLE_FOOTNOTES);
let p = Parser::new_ext(&text, opts);
html::push_html(&mut s, p); html::push_html(&mut s, p);
s s
} }