@@ -18,6 +18,14 @@ use std::vec;
18
18
pub struct Markdown < ' self > ( & ' self str ) ;
19
19
20
20
static OUTPUT_UNIT : libc:: size_t = 64 ;
21
+ static MKDEXT_NO_INTRA_EMPHASIS : libc:: c_uint = 1 << 0 ;
22
+ static MKDEXT_TABLES : libc:: c_uint = 1 << 1 ;
23
+ static MKDEXT_FENCED_CODE : libc:: c_uint = 1 << 2 ;
24
+ static MKDEXT_AUTOLINK : libc:: c_uint = 1 << 3 ;
25
+ static MKDEXT_STRIKETHROUGH : libc:: c_uint = 1 << 4 ;
26
+ static MKDEXT_SPACE_HEADERS : libc:: c_uint = 1 << 6 ;
27
+ static MKDEXT_SUPERSCRIPT : libc:: c_uint = 1 << 7 ;
28
+ static MKDEXT_LAX_SPACING : libc:: c_uint = 1 << 8 ;
21
29
22
30
type sd_markdown = libc:: c_void ; // this is opaque to us
23
31
@@ -67,6 +75,9 @@ fn render(w: &mut io::Writer, s: &str) {
67
75
// This code is all lifted from examples/sundown.c in the sundown repo
68
76
unsafe {
69
77
let ob = bufnew ( OUTPUT_UNIT ) ;
78
+ let extensions = MKDEXT_NO_INTRA_EMPHASIS | MKDEXT_TABLES |
79
+ MKDEXT_FENCED_CODE | MKDEXT_AUTOLINK |
80
+ MKDEXT_STRIKETHROUGH ;
70
81
let options = html_renderopt {
71
82
toc_data : html_toc_data {
72
83
header_count : 0 ,
@@ -79,7 +90,7 @@ fn render(w: &mut io::Writer, s: &str) {
79
90
let callbacks: sd_callbacks = [ 0 , ..26 ] ;
80
91
81
92
sdhtml_renderer ( & callbacks, & options, 0 ) ;
82
- let markdown = sd_markdown_new ( 0 , 16 , & callbacks,
93
+ let markdown = sd_markdown_new ( extensions , 16 , & callbacks,
83
94
& options as * html_renderopt as * libc:: c_void ) ;
84
95
85
96
do s. as_imm_buf |data, len| {
0 commit comments