Skip to content

Commit d000fc8

Browse files
committed
Updated pulldown-cmark to version 0.0.5
Version 0.0.5 contains table and footnotes support, both options are now enabled in mdBook.
1 parent 5170e6b commit d000fc8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exclude = [
1818
clap = "~1.5.3"
1919
handlebars = "~0.12.0"
2020
rustc-serialize = "~0.3.16"
21-
pulldown-cmark = "~0.0.3"
21+
pulldown-cmark = "~0.0.5"
2222

2323

2424
# Watch feature

src/utils/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf, Component};
44
use std::error::Error;
55
use std::fs::{self, metadata, File};
66

7-
use self::pulldown_cmark::{Parser, html};
7+
use self::pulldown_cmark::{Parser, html, Options, OPTION_ENABLE_TABLES, OPTION_ENABLE_FOOTNOTES};
88

99
/// This is copied from the rust source code until Path_ Ext stabilizes.
1010
/// 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
188188
189189
pub fn render_markdown(text: &str) -> String {
190190
let mut s = String::with_capacity(text.len() * 3 / 2);
191-
let p = Parser::new(&text);
191+
192+
let mut opts = Options::empty();
193+
opts.insert(OPTION_ENABLE_TABLES);
194+
opts.insert(OPTION_ENABLE_FOOTNOTES);
195+
196+
let p = Parser::new_ext(&text, opts);
192197
html::push_html(&mut s, p);
193198
s
194199
}

0 commit comments

Comments
 (0)