From d000fc8bac48b33a0451e5647327f96e5af04c96 Mon Sep 17 00:00:00 2001 From: Mathieu David Date: Sun, 3 Jan 2016 12:02:39 +0100 Subject: [PATCH] Updated pulldown-cmark to version 0.0.5 Version 0.0.5 contains table and footnotes support, both options are now enabled in mdBook. --- Cargo.toml | 2 +- src/utils/mod.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c6218368..594b6236 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ exclude = [ clap = "~1.5.3" handlebars = "~0.12.0" rustc-serialize = "~0.3.16" -pulldown-cmark = "~0.0.3" +pulldown-cmark = "~0.0.5" # Watch feature diff --git a/src/utils/mod.rs b/src/utils/mod.rs index a808d32e..ef6f066e 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf, Component}; use std::error::Error; 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. /// 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 { 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); s }