diff -Nru rust-pulldown-cmark-0.2.0/build.rs rust-pulldown-cmark-0.8.0/build.rs --- rust-pulldown-cmark-0.2.0/build.rs 2018-11-07 16:19:31.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/build.rs 2020-09-01 15:22:39.000000000 +0000 @@ -1,11 +1,10 @@ - fn main() { generate_tests_from_spec() } // If the "gen-tests" feature is absent, // this function will be compiled down to nothing -#[cfg(not(feature="gen-tests"))] +#[cfg(not(feature = "gen-tests"))] fn generate_tests_from_spec() {} // If the feature is present, generate tests @@ -19,132 +18,167 @@ // . // expected html output // ```````````````````````````````` -#[cfg(feature="gen-tests")] +#[cfg(feature = "gen-tests")] fn generate_tests_from_spec() { - use std::path::{PathBuf}; use std::fs::{self, File}; use std::io::{Read, Write}; + use std::path::PathBuf; // This is a hardcoded path to the CommonMark spec because it is not situated in // the specs/ directory. It's in an array to easily chain it to the other iterator // and make it easy to eventually add other hardcoded paths in the future if needed - let hardcoded = ["./third_party/CommonMark/spec.txt"]; - let hardcoded_iter = hardcoded.into_iter() - .map(PathBuf::from); + let hardcoded = [ + "./third_party/CommonMark/spec.txt", + "./third_party/CommonMark/smart_punct.txt", + "./third_party/GitHub/gfm_table.txt", + "./third_party/GitHub/gfm_strikethrough.txt", + "./third_party/GitHub/gfm_tasklist.txt", + ]; + let hardcoded_iter = hardcoded.iter().map(PathBuf::from); // Create an iterator over the files in the specs/ directory that have a .txt extension let spec_files = fs::read_dir("./specs") - .expect("Could not find the 'specs' directory") - .filter_map(Result::ok) - .map(|d| d.path()) - .filter(|p| p.extension().map(|e| e.to_owned()).is_some()) - .chain(hardcoded_iter); + .expect("Could not find the 'specs' directory") + .filter_map(Result::ok) + .map(|d| d.path()) + .filter(|p| p.extension().map(|e| e.to_owned()).is_some()) + .chain(hardcoded_iter) + .collect::>(); - for file_path in spec_files { + for file_path in &spec_files { let mut raw_spec = String::new(); File::open(&file_path) - .and_then(|mut f| f.read_to_string(&mut raw_spec)) - .expect("Could not read the spec file"); + .and_then(|mut f| f.read_to_string(&mut raw_spec)) + .expect("Could not read the spec file"); - let rs_test_file = PathBuf::from("./tests/") - .join(file_path.file_name().expect("Invalid filename")) - .with_extension("rs"); + let rs_test_file = PathBuf::from("./tests/suite/") + .join(file_path.file_name().expect("Invalid filename")) + .with_extension("rs"); - let mut spec_rs = File::create(&rs_test_file) - .expect(&format!("Could not create {:?}", rs_test_file)); + let mut spec_rs = + File::create(&rs_test_file).expect(&format!("Could not create {:?}", rs_test_file)); let spec_name = file_path.file_stem().unwrap().to_str().unwrap(); let spec = Spec::new(&raw_spec); let mut n_tests = 0; - spec_rs.write(b"// This file is auto-generated by the build script\n").unwrap(); - spec_rs.write(b"// Please, do not modify it manually\n").unwrap(); - spec_rs.write(b"\nextern crate pulldown_cmark;\n").unwrap(); + spec_rs + .write(b"// This file is auto-generated by the build script\n") + .unwrap(); + spec_rs + .write(b"// Please, do not modify it manually\n") + .unwrap(); + spec_rs + .write(b"\nuse super::test_markdown_html;\n") + .unwrap(); for (i, testcase) in spec.enumerate() { - spec_rs.write_fmt( - format_args!( + spec_rs + .write_fmt(format_args!( r###" - - #[test] - fn {}_test_{i}() {{ - let original = r##"{original}"##; - let expected = r##"{expected}"##; - - use pulldown_cmark::{{Parser, html, Options}}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - }}"###, +#[test] +fn {}_test_{i}() {{ + let original = r##"{original}"##; + let expected = r##"{expected}"##; + + test_markdown_html(original, expected, {smart_punct}); +}} +"###, spec_name, - i=i+1, - original=testcase.original, - expected=testcase.expected - ), - ).unwrap(); + i = i + 1, + original = testcase.original, + expected = testcase.expected, + smart_punct = testcase.smart_punct, + )) + .unwrap(); n_tests += 1; } - println!("cargo:warning=Generated {} tests in {:?}", n_tests, rs_test_file); + println!( + "cargo:warning=Generated {} tests in {:?}", + n_tests, rs_test_file + ); + } + + // write mods to suite/mod.rs + let suite_mod_file = PathBuf::from("./tests/suite/mod").with_extension("rs"); + + let mut mod_rs = + File::create(&suite_mod_file).expect(&format!("Could not create {:?}", &suite_mod_file)); + + mod_rs + .write(b"// This file is auto-generated by the build script\n") + .unwrap(); + mod_rs + .write(b"// Please, do not modify it manually\n") + .unwrap(); + mod_rs + .write(b"\npub use super::test_markdown_html;\n\n") + .unwrap(); + + for file_path in &spec_files { + let mod_name = file_path.file_stem().unwrap().to_str().unwrap(); + mod_rs.write(b"mod ").unwrap(); + mod_rs.write(mod_name.as_bytes()).unwrap(); + mod_rs.write(b";\n").unwrap(); } } -#[cfg(feature="gen-tests")] +#[cfg(feature = "gen-tests")] pub struct Spec<'a> { spec: &'a str, } -#[cfg(feature="gen-tests")] +#[cfg(feature = "gen-tests")] impl<'a> Spec<'a> { pub fn new(spec: &'a str) -> Self { - Spec{ spec: spec } + Spec { spec } } } -#[cfg(feature="gen-tests")] +#[cfg(feature = "gen-tests")] pub struct TestCase { pub original: String, pub expected: String, + pub smart_punct: bool, } -#[cfg(feature="gen-tests")] +#[cfg(feature = "gen-tests")] impl<'a> Iterator for Spec<'a> { type Item = TestCase; fn next(&mut self) -> Option { let spec = self.spec; + let prefix = "```````````````````````````````` example"; - let i_start = match self.spec.find("```````````````````````````````` example\n").map(|pos| pos + 41) { - Some(pos) => pos, - None => return None, - }; - - let i_end = match self.spec[i_start..].find("\n.\n").map(|pos| (pos + 1) + i_start){ - Some(pos) => pos, - None => return None, - }; - - let e_end = match self.spec[i_end + 2..].find("````````````````````````````````\n").map(|pos| pos + i_end + 2){ - Some(pos) => pos, - None => return None, - }; + let (i_start, smart_punct) = self.spec.find(prefix).and_then(|pos| { + let suffix = "_smartpunct\n"; + if spec[(pos + prefix.len())..].starts_with(suffix) { + Some((pos + prefix.len() + suffix.len(), true)) + } else if spec[(pos + prefix.len())..].starts_with('\n') { + Some((pos + prefix.len() + 1, false)) + } else { + None + } + })?; + + let i_end = self.spec[i_start..] + .find("\n.\n") + .map(|pos| (pos + 1) + i_start)?; + + let e_end = self.spec[i_end + 2..] + .find("````````````````````````````````\n") + .map(|pos| pos + i_end + 2)?; - self.spec = &self.spec[e_end + 33 ..]; + self.spec = &self.spec[e_end + 33..]; let test_case = TestCase { - original: spec[i_start .. i_end].to_string().replace("→", "\t"), - expected: spec[i_end + 2 .. e_end].to_string().replace("→", "\t") + original: spec[i_start..i_end].to_string().replace("→", "\t"), + expected: spec[i_end + 2..e_end].to_string().replace("→", "\t"), + smart_punct, }; Some(test_case) diff -Nru rust-pulldown-cmark-0.2.0/Cargo.lock rust-pulldown-cmark-0.8.0/Cargo.lock --- rust-pulldown-cmark-0.2.0/Cargo.lock 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/Cargo.lock 2020-09-01 15:23:36.000000000 +0000 @@ -0,0 +1,924 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bstr" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.57 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion-plot" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bstr 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getopts" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "half" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hermit-abi" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "html5ever" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "js-sys" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.76" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "markup5ever" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.57 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache_codegen 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "markup5ever_rcdom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "xml5ever 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num-traits" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "oorandom" +version = "11.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "plotters" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pulldown-cmark" +version = "0.8.0" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-channel 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.115" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_cbor" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "half 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "siphasher" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "string_cache" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tendril" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tinytemplate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.57 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "utf-8" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasm-bindgen" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "web-sys" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "xml5ever" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)" = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum bstr 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +"checksum bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)" = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +"checksum criterion 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +"checksum criterion-plot 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d" +"checksum crossbeam-channel 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6" +"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +"checksum either 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" +"checksum futf 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b" +"checksum getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum half 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +"checksum hermit-abi 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +"checksum html5ever 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcf38a1a36118242d29b92e1b08ef84e67e4a5ed06e0a80be20e6a32bfed6b" +"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +"checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +"checksum js-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.76 (registry+https://github.com/rust-lang/crates.io-index)" = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3" +"checksum log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" +"checksum markup5ever 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aae38d669396ca9b707bfc3db254bc382ddb94f57cc5c235f34623a669a01dab" +"checksum markup5ever_rcdom 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f015da43bcd8d4f144559a3423f4591d69b8ce0652c905374da7205df336ae2b" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +"checksum memoffset 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" +"checksum new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +"checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +"checksum oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" +"checksum phf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +"checksum phf_codegen 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +"checksum phf_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +"checksum phf_shared 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +"checksum plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +"checksum ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +"checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +"checksum proc-macro2 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rand_pcg 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +"checksum rayon 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd016f0c045ad38b5251be2c9c0ab806917f82da4d36b2a327e5166adad9270" +"checksum rayon-core 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91739a34c4355b5434ce54c9086c5895604a9c278586d1f1aa95e04f66b525a0" +"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +"checksum regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)" = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" +"checksum serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" +"checksum serde_derive 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)" = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48" +"checksum serde_json 1.0.57 (registry+https://github.com/rust-lang/crates.io-index)" = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" +"checksum siphasher 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" +"checksum string_cache 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2940c75beb4e3bf3a494cef919a747a2cb81e52571e212bfbd185074add7208a" +"checksum string_cache_codegen 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" +"checksum syn 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "891d8d6567fe7c7f8835a3a98af4208f3846fba258c1bc3c31d6e506239f11f9" +"checksum tendril 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "707feda9f2582d5d680d733e38755547a3e8fb471e7ba11452ecfd9ce93a5d3b" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +"checksum time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +"checksum tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +"checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +"checksum unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +"checksum utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" +"checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" +"checksum wasm-bindgen-backend 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" +"checksum wasm-bindgen-macro 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" +"checksum wasm-bindgen-macro-support 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" +"checksum wasm-bindgen-shared 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" +"checksum web-sys 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" +"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum xml5ever 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59" diff -Nru rust-pulldown-cmark-0.2.0/Cargo.toml rust-pulldown-cmark-0.8.0/Cargo.toml --- rust-pulldown-cmark-0.2.0/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/Cargo.toml 2020-09-01 15:23:36.000000000 +0000 @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -11,27 +11,58 @@ # will likely look very different (and much more reasonable) [package] +edition = "2018" name = "pulldown-cmark" -version = "0.2.0" -authors = ["Raph Levien "] +version = "0.8.0" +authors = ["Raph Levien ", "Marcus Klaas de Vries "] build = "build.rs" +exclude = ["/third_party/**/*", "/tools/**/*", "/specs/**/*", "/fuzzer/**/*", "/azure-pipelines.yml"] description = "A pull parser for CommonMark" +readme = "README.md" keywords = ["markdown", "commonmark"] categories = ["text-processing"] license = "MIT" -repository = "https://github.com/google/pulldown-cmark" +repository = "https://github.com/raphlinus/pulldown-cmark" [[bin]] name = "pulldown-cmark" doc = false required-features = ["getopts"] + +[[bench]] +name = "html_rendering" +harness = false [dependencies.bitflags] -version = "1.0" +version = "1.2" [dependencies.getopts] version = "0.2" optional = true +[dependencies.memchr] +version = "2.3" + +[dependencies.unicase] +version = "2.6" +[dev-dependencies.criterion] +version = "0.3" + +[dev-dependencies.html5ever] +version = "0.25" + +[dev-dependencies.lazy_static] +version = "1.4" + +[dev-dependencies.markup5ever_rcdom] +version = "0.1" + +[dev-dependencies.regex] +version = "1.3" + +[dev-dependencies.tendril] +version = "0.4" + [features] default = ["getopts"] gen-tests = [] +simd = [] diff -Nru rust-pulldown-cmark-0.2.0/Cargo.toml.orig rust-pulldown-cmark-0.8.0/Cargo.toml.orig --- rust-pulldown-cmark-0.2.0/Cargo.toml.orig 2018-11-07 16:24:07.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/Cargo.toml.orig 2020-09-01 15:22:39.000000000 +0000 @@ -1,12 +1,15 @@ [package] name = "pulldown-cmark" -version = "0.2.0" -authors = [ "Raph Levien " ] +version = "0.8.0" +authors = [ "Raph Levien ", "Marcus Klaas de Vries " ] license = "MIT" description = "A pull parser for CommonMark" -repository = "https://github.com/google/pulldown-cmark" +repository = "https://github.com/raphlinus/pulldown-cmark" keywords = ["markdown", "commonmark"] categories = ["text-processing"] +edition = "2018" +readme = "README.md" +exclude = ["/third_party/**/*", "/tools/**/*", "/specs/**/*", "/fuzzer/**/*", "/azure-pipelines.yml"] build = "build.rs" @@ -15,10 +18,25 @@ required-features = ["getopts"] doc = false +[[bench]] +name = "html_rendering" +harness = false + [dependencies] -bitflags = "1.0" +bitflags = "1.2" +unicase = "2.6" +memchr = "2.3" getopts = { version = "0.2", optional = true } +[dev-dependencies] +html5ever = "0.25" +markup5ever_rcdom = "0.1" +lazy_static = "1.4" +tendril = "0.4" +criterion = "0.3" +regex = "1.3" + [features] default = ["getopts"] gen-tests = [] +simd = [] diff -Nru rust-pulldown-cmark-0.2.0/.cargo_vcs_info.json rust-pulldown-cmark-0.8.0/.cargo_vcs_info.json --- rust-pulldown-cmark-0.2.0/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/.cargo_vcs_info.json 2020-09-01 15:23:36.000000000 +0000 @@ -0,0 +1,5 @@ +{ + "git": { + "sha1": "d4bf0872b14f68c1afedee918710fb401e3e6e9a" + } +} diff -Nru rust-pulldown-cmark-0.2.0/CONTRIBUTING.md rust-pulldown-cmark-0.8.0/CONTRIBUTING.md --- rust-pulldown-cmark-0.2.0/CONTRIBUTING.md 2018-11-07 16:19:31.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/CONTRIBUTING.md 2020-08-21 13:57:35.000000000 +0000 @@ -1,11 +1,21 @@ Want to contribute? Great! First, read this page. ### Before you contribute + Before you start working on a larger contribution, you should get in touch with us first through the issue tracker with your idea so that we can help out and possibly guide you. Coordinating up front makes it much easier to avoid frustration later on. +### Getting familiar with the project + +**The architecture** is somewhat unique, it was originally inspired by [XML pull parsers](http://www.xmlpull.org), but ended up going in somewhat its own direction. to get familiar with it, +- start my reading the [README](README.md) page, which gives some details on the design of the parser (pull-based events) and some rationalization for it ; +- read the [blog post](https://fullyfaithful.eu/pulldown-cmark) about the release of Pulldown-cmark 0.3 by Marcus Klaas de Vries. + +**The source code** can be approached by skimming the [API documentation](https://docs.rs/pulldown-cmark/latest/pulldown_cmark) first, then explore the code for the main struct, [`Parser`](https://docs.rs/pulldown-cmark/latest/pulldown_cmark/struct.Parser.html) + ### Code reviews + All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. diff -Nru rust-pulldown-cmark-0.2.0/debian/cargo-checksum.json rust-pulldown-cmark-0.8.0/debian/cargo-checksum.json --- rust-pulldown-cmark-0.2.0/debian/cargo-checksum.json 2018-11-20 13:03:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/cargo-checksum.json 2021-09-03 20:44:41.000000000 +0000 @@ -1 +1 @@ -{"package":"eef52fac62d0ea7b9b4dc7da092aa64ea7ec3d90af6679422d3d7e0e14b6ee15","files":{}} +{"package":"Could not get crate checksum","files":{}} diff -Nru rust-pulldown-cmark-0.2.0/debian/changelog rust-pulldown-cmark-0.8.0/debian/changelog --- rust-pulldown-cmark-0.2.0/debian/changelog 2020-04-29 11:37:42.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/changelog 2021-09-03 20:44:41.000000000 +0000 @@ -1,14 +1,8 @@ -rust-pulldown-cmark (0.2.0-1build2) groovy; urgency=high +rust-pulldown-cmark (0.8.0-1) unstable; urgency=medium - * No change rebuild to remove /usr/.crates2.json (LP: #1868517). + * Package pulldown-cmark 0.8.0 from crates.io using debcargo 2.4.4-alpha.0 - -- Julian Andres Klode Wed, 29 Apr 2020 13:37:42 +0200 - -rust-pulldown-cmark (0.2.0-1build1) focal; urgency=medium - - * No-change rebuild for libgcc-s1 package name change. - - -- Matthias Klose Sun, 22 Mar 2020 16:56:53 +0100 + -- Wolfgang Silbermayr Fri, 03 Sep 2021 22:44:41 +0200 rust-pulldown-cmark (0.2.0-1) unstable; urgency=medium diff -Nru rust-pulldown-cmark-0.2.0/debian/compat rust-pulldown-cmark-0.8.0/debian/compat --- rust-pulldown-cmark-0.2.0/debian/compat 2018-11-20 13:03:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/compat 2021-09-03 20:44:41.000000000 +0000 @@ -1 +1 @@ -11 +12 diff -Nru rust-pulldown-cmark-0.2.0/debian/control rust-pulldown-cmark-0.8.0/debian/control --- rust-pulldown-cmark-0.2.0/debian/control 2020-04-29 11:37:42.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/control 2021-09-03 20:44:41.000000000 +0000 @@ -1,40 +1,46 @@ Source: rust-pulldown-cmark Section: rust Priority: optional -Build-Depends: debhelper (>= 11), - dh-cargo (>= 10), +Build-Depends: debhelper (>= 12), + dh-cargo (>= 26), cargo:native, rustc:native, libstd-rust-dev, - librust-bitflags-1+default-dev, + librust-bitflags-1+default-dev (>= 1.2-~~), librust-getopts-0.2+default-dev, + librust-memchr-2+default-dev (>= 2.3-~~), + librust-unicase-2+default-dev (>= 2.6-~~), help2man -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Rust Maintainers +Maintainer: Debian Rust Maintainers Uploaders: Wolfgang Silbermayr -Standards-Version: 4.2.0 +Standards-Version: 4.5.1 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/pulldown-cmark] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/pulldown-cmark +Rules-Requires-Root: no Package: librust-pulldown-cmark-dev Architecture: any Multi-Arch: same Depends: ${misc:Depends}, - librust-bitflags-1+default-dev + librust-bitflags-1+default-dev (>= 1.2-~~), + librust-memchr-2+default-dev (>= 2.3-~~), + librust-unicase-2+default-dev (>= 2.6-~~) Recommends: librust-pulldown-cmark+default-dev (= ${binary:Version}) -Suggests: - librust-pulldown-cmark+getopts-dev (= ${binary:Version}) Provides: librust-pulldown-cmark+gen-tests-dev (= ${binary:Version}), + librust-pulldown-cmark+simd-dev (= ${binary:Version}), librust-pulldown-cmark-0-dev (= ${binary:Version}), librust-pulldown-cmark-0+gen-tests-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2+gen-tests-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2.0-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2.0+gen-tests-dev (= ${binary:Version}) + librust-pulldown-cmark-0+simd-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8+gen-tests-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8+simd-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8.0-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8.0+gen-tests-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8.0+simd-dev (= ${binary:Version}) Description: Pull parser for CommonMark - Rust source code This package contains the source for the Rust pulldown-cmark crate, packaged by debcargo for use with cargo and dh-cargo. @@ -47,27 +53,18 @@ librust-pulldown-cmark-dev (= ${binary:Version}), librust-getopts-0.2+default-dev Provides: + librust-pulldown-cmark+getopts-dev (= ${binary:Version}), librust-pulldown-cmark-0+default-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2+default-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2.0+default-dev (= ${binary:Version}) -Description: Pull parser for CommonMark - feature "default" - This metapackage enables feature default for the Rust pulldown-cmark crate, by - pulling in any additional dependencies needed by that feature. - -Package: librust-pulldown-cmark+getopts-dev -Architecture: any -Multi-Arch: same -Depends: - ${misc:Depends}, - librust-pulldown-cmark-dev (= ${binary:Version}), - librust-getopts-0.2+default-dev -Provides: librust-pulldown-cmark-0+getopts-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2+getopts-dev (= ${binary:Version}), - librust-pulldown-cmark-0.2.0+getopts-dev (= ${binary:Version}) -Description: Pull parser for CommonMark - feature "getopts" - This metapackage enables feature getopts for the Rust pulldown-cmark crate, by - pulling in any additional dependencies needed by that feature. + librust-pulldown-cmark-0.8+default-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8+getopts-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8.0+default-dev (= ${binary:Version}), + librust-pulldown-cmark-0.8.0+getopts-dev (= ${binary:Version}) +Description: Pull parser for CommonMark - feature "default" and 1 more + This metapackage enables feature "default" for the Rust pulldown-cmark crate, + by pulling in any additional dependencies needed by that feature. + . + Additionally, this package also provides the "getopts" feature. Package: pulldown-cmark Architecture: any @@ -75,14 +72,17 @@ Section: text Depends: ${misc:Depends}, - ${shlibs:Depends} + ${shlibs:Depends}, + ${cargo:Depends} +Recommends: + ${cargo:Recommends} +Suggests: + ${cargo:Suggests} +Provides: + ${cargo:Provides} Built-Using: ${cargo:Built-Using} XB-X-Cargo-Built-Using: ${cargo:X-Cargo-Built-Using} Description: Simple command-line tool for rendering CommonMark to HTML pulldown-cmark is a pull parser library for CommonMark, written in Rust. This package contains a simple command-line tool for rendering to HTML, based on the library. - . - This package contains the following binaries built from the Rust crate - "pulldown-cmark": - - pulldown-cmark diff -Nru rust-pulldown-cmark-0.2.0/debian/copyright rust-pulldown-cmark-0.8.0/debian/copyright --- rust-pulldown-cmark-0.2.0/debian/copyright 2018-11-20 13:03:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/copyright 2021-09-03 20:44:41.000000000 +0000 @@ -1,24 +1,21 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pulldown-cmark -Upstream-Contact: Raph Levien +Upstream-Contact: + Raph Levien + Marcus Klaas de Vries Source: https://github.com/google/pulldown-cmark Files: * -Copyright: 2015-2018 Raph Levien -License: MIT - -Files: ./third_party/CommonMark/spec.txt -Copyright: 2014-2017 John MacFarlane -License: CC-BY-SA-4.0 - -Files: ./tools/* -Copyright: 2015 Google Inc. All rights reserved. +Copyright: + 2015-2020 Raph Levien + 2019-2021 Marcus Klaas de Vries + 2015 Google Inc. License: MIT Files: debian/* Copyright: - 2018 Debian Rust Maintainers - 2018 Wolfgang Silbermayr + 2018-2021 Debian Rust Maintainers + 2018-2021 Wolfgang Silbermayr License: MIT License: MIT @@ -39,431 +36,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -License: CC-BY-SA-4.0 - Attribution-ShareAlike 4.0 International - . - ======================================================================= - . - Creative Commons Corporation ("Creative Commons") is not a law firm and - does not provide legal services or legal advice. Distribution of - Creative Commons public licenses does not create a lawyer-client or - other relationship. Creative Commons makes its licenses and related - information available on an "as-is" basis. Creative Commons gives no - warranties regarding its licenses, any material licensed under their - terms and conditions, or any related information. Creative Commons - disclaims all liability for damages resulting from their use to the - fullest extent possible. - . - Using Creative Commons Public Licenses - . - Creative Commons public licenses provide a standard set of terms and - conditions that creators and other rights holders may use to share - original works of authorship and other material subject to copyright - and certain other rights specified in the public license below. The - following considerations are for informational purposes only, are not - exhaustive, and do not form part of our licenses. - . - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - . - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - . - ======================================================================= - . - Creative Commons Attribution-ShareAlike 4.0 International Public - License - . - By exercising the Licensed Rights (defined below), You accept and agree - to be bound by the terms and conditions of this Creative Commons - Attribution-ShareAlike 4.0 International Public License ("Public - License"). To the extent this Public License may be interpreted as a - contract, You are granted the Licensed Rights in consideration of Your - acceptance of these terms and conditions, and the Licensor grants You - such rights in consideration of benefits the Licensor receives from - making the Licensed Material available under these terms and - conditions. - . - . - Section 1 -- Definitions. - . - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - . - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - . - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - . - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - . - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - . - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - . - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - . - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - . - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - . - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - . - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - . - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - . - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - . - . - Section 2 -- Scope. - . - a. License grant. - . - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - . - a. reproduce and Share the Licensed Material, in whole or - in part; and - . - b. produce, reproduce, and Share Adapted Material. - . - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - . - 3. Term. The term of this Public License is specified in Section - 6(a). - . - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - . - 5. Downstream recipients. - . - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - . - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - . - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - . - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - . - b. Other rights. - . - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - . - 2. Patent and trademark rights are not licensed under this - Public License. - . - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - . - . - Section 3 -- License Conditions. - . - Your exercise of the Licensed Rights is expressly made subject to the - following conditions. - . - a. Attribution. - . - 1. If You Share the Licensed Material (including in modified - form), You must: - . - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - . - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - . - ii. a copyright notice; - . - iii. a notice that refers to this Public License; - . - iv. a notice that refers to the disclaimer of - warranties; - . - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - . - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - . - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - . - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - . - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - . - b. ShareAlike. - . - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - . - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - . - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - . - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - . - . - Section 4 -- Sui Generis Database Rights. - . - Where the Licensed Rights include Sui Generis Database Rights that - apply to Your use of the Licensed Material: - . - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - . - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - . - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - . - For the avoidance of doubt, this Section 4 supplements and does not - replace Your obligations under this Public License where the Licensed - Rights include other Copyright and Similar Rights. - . - . - Section 5 -- Disclaimer of Warranties and Limitation of Liability. - . - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - . - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - . - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - . - . - Section 6 -- Term and Termination. - . - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - . - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - . - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - . - 2. upon express reinstatement by the Licensor. - . - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - . - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - . - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - . - . - Section 7 -- Other Terms and Conditions. - . - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - . - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - . - . - Section 8 -- Interpretation. - . - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - . - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - . - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - . - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - . - . - ======================================================================= - . - Creative Commons is not a party to its public licenses. - Notwithstanding, Creative Commons may elect to apply one of its public - licenses to material it publishes and in those instances will be - considered the "Licensor." Except for the limited purpose of indicating - that material is shared under a Creative Commons public license or as - otherwise permitted by the Creative Commons policies published at - creativecommons.org/policies, Creative Commons does not authorize the - use of the trademark "Creative Commons" or any other trademark or logo - of Creative Commons without its prior written consent including, - without limitation, in connection with any unauthorized modifications - to any of its public licenses or any other arrangements, - understandings, or agreements concerning use of licensed material. For - the avoidance of doubt, this paragraph does not form part of the public - licenses. - . - Creative Commons may be contacted at creativecommons.org. - diff -Nru rust-pulldown-cmark-0.2.0/debian/copyright.debcargo.hint rust-pulldown-cmark-0.8.0/debian/copyright.debcargo.hint --- rust-pulldown-cmark-0.2.0/debian/copyright.debcargo.hint 2018-11-20 13:03:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/copyright.debcargo.hint 2021-09-03 20:44:41.000000000 +0000 @@ -1,10 +1,14 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pulldown-cmark -Upstream-Contact: Raph Levien -Source: https://github.com/google/pulldown-cmark +Upstream-Contact: + Raph Levien + Marcus Klaas de Vries +Source: https://github.com/raphlinus/pulldown-cmark Files: * -Copyright: FIXME (overlay) UNKNOWN-YEARS Raph Levien +Copyright: + FIXME (overlay) UNKNOWN-YEARS Raph Levien + FIXME (overlay) UNKNOWN-YEARS Marcus Klaas de Vries License: MIT Comment: FIXME (overlay): Since upstream copyright years are not available in @@ -47,22 +51,22 @@ FIXME (overlay): These notices are extracted from files. Please review them before uploading to the archive. -Files: ./src/main.rs -Copyright: 2015 Google Inc. All rights reserved. +Files: ./src/linklabel.rs +Copyright: 2018 Google LLC License: UNKNOWN-LICENSE; FIXME (overlay) Comment: FIXME (overlay): These notices are extracted from files. Please review them before uploading to the archive. -Files: ./src/parse.rs +Files: ./src/main.rs Copyright: 2015 Google Inc. All rights reserved. License: UNKNOWN-LICENSE; FIXME (overlay) Comment: FIXME (overlay): These notices are extracted from files. Please review them before uploading to the archive. -Files: ./src/passes.rs -Copyright: 2015 Google Inc. All rights reserved. +Files: ./src/parse.rs +Copyright: 2017 Google Inc. All rights reserved. License: UNKNOWN-LICENSE; FIXME (overlay) Comment: FIXME (overlay): These notices are extracted from files. Please review them @@ -82,33 +86,8 @@ FIXME (overlay): These notices are extracted from files. Please review them before uploading to the archive. -Files: ./src/utils.rs -Copyright: 2015 Google Inc. All rights reserved. -License: UNKNOWN-LICENSE; FIXME (overlay) -Comment: - FIXME (overlay): These notices are extracted from files. Please review them - before uploading to the archive. - -Files: ./third_party/CommonMark/LICENSE -Copyright: 2014-16 John MacFarlane -License: UNKNOWN-LICENSE; FIXME (overlay) -Comment: - FIXME (overlay): These notices are extracted from files. Please review them - before uploading to the archive. - -Files: ./tools/mk_entities.py -Copyright: - 2015 Google Inc. All rights reserved. - 2015 Google Inc. All rights reserved. -License: UNKNOWN-LICENSE; FIXME (overlay) -Comment: - FIXME (overlay): These notices are extracted from files. Please review them - before uploading to the archive. - -Files: ./tools/mk_puncttable.py -Copyright: - 2015 Google Inc. All rights reserved. - 2015 Google Inc. All rights reserved. +Files: ./src/tree.rs +Copyright: 2018 Google LLC License: UNKNOWN-LICENSE; FIXME (overlay) Comment: FIXME (overlay): These notices are extracted from files. Please review them @@ -116,8 +95,8 @@ Files: debian/* Copyright: - 2018 Debian Rust Maintainers - 2018 Wolfgang Silbermayr + 2018-2021 Debian Rust Maintainers + 2018-2021 Wolfgang Silbermayr License: MIT License: MIT diff -Nru rust-pulldown-cmark-0.2.0/debian/debcargo.toml rust-pulldown-cmark-0.8.0/debian/debcargo.toml --- rust-pulldown-cmark-0.2.0/debian/debcargo.toml 2018-11-20 13:03:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/debcargo.toml 2021-09-03 20:44:41.000000000 +0000 @@ -1,5 +1,6 @@ overlay = "." uploaders = ["Wolfgang Silbermayr "] +excludes = ["benches/**"] [source] build_depends = ["help2man"] @@ -12,3 +13,13 @@ package contains a simple command-line tool for rendering to HTML, based on the library. """ + +[packages."lib+@"] +# The `specs` subdirectory is not published to crates.io, it would be +# required for this test +test_is_broken = true + +[packages."lib+gen-tests"] +# The ´specs` subdirectory is not published to crates.io, it would be +# required for this test +test_is_broken = true diff -Nru rust-pulldown-cmark-0.2.0/debian/librust-pulldown-cmark+default-dev.lintian-overrides rust-pulldown-cmark-0.8.0/debian/librust-pulldown-cmark+default-dev.lintian-overrides --- rust-pulldown-cmark-0.2.0/debian/librust-pulldown-cmark+default-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/librust-pulldown-cmark+default-dev.lintian-overrides 2021-09-03 20:44:41.000000000 +0000 @@ -0,0 +1 @@ +librust-pulldown-cmark+default-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-pulldown-cmark-0.2.0/debian/patches/remove-benchmark.diff rust-pulldown-cmark-0.8.0/debian/patches/remove-benchmark.diff --- rust-pulldown-cmark-0.2.0/debian/patches/remove-benchmark.diff 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/patches/remove-benchmark.diff 2021-09-03 20:44:41.000000000 +0000 @@ -0,0 +1,21 @@ +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -29,9 +29,6 @@ + doc = false + required-features = ["getopts"] + +-[[bench]] +-name = "html_rendering" +-harness = false + [dependencies.bitflags] + version = "1.2" + +@@ -44,8 +41,6 @@ + + [dependencies.unicase] + version = "2.6" +-[dev-dependencies.criterion] +-version = "0.3" + + [dev-dependencies.html5ever] + version = "0.25" diff -Nru rust-pulldown-cmark-0.2.0/debian/patches/series rust-pulldown-cmark-0.8.0/debian/patches/series --- rust-pulldown-cmark-0.2.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/patches/series 2021-09-03 20:44:41.000000000 +0000 @@ -0,0 +1 @@ +remove-benchmark.diff diff -Nru rust-pulldown-cmark-0.2.0/debian/tests/control rust-pulldown-cmark-0.8.0/debian/tests/control --- rust-pulldown-cmark-0.2.0/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/tests/control 2021-09-03 20:44:41.000000000 +0000 @@ -0,0 +1,29 @@ +Test-Command: /usr/share/cargo/bin/cargo-auto-test pulldown-cmark 0.8.0 --all-targets --all-features +Features: test-name=rust-pulldown-cmark:@ +Depends: dh-cargo (>= 18), librust-html5ever-0.25+default-dev, librust-lazy-static-1+default-dev (>= 1.4-~~), librust-markup5ever-rcdom-0.1+default-dev, librust-regex-1+default-dev (>= 1.3-~~), librust-tendril-0.4+default-dev, @ +Restrictions: allow-stderr, skip-not-installable, flaky + +Test-Command: /usr/share/cargo/bin/cargo-auto-test pulldown-cmark 0.8.0 --all-targets --no-default-features --features gen-tests +Features: test-name=librust-pulldown-cmark-dev:gen-tests +Depends: dh-cargo (>= 18), librust-html5ever-0.25+default-dev, librust-lazy-static-1+default-dev (>= 1.4-~~), librust-markup5ever-rcdom-0.1+default-dev, librust-regex-1+default-dev (>= 1.3-~~), librust-tendril-0.4+default-dev, @ +Restrictions: allow-stderr, skip-not-installable, flaky + +Test-Command: /usr/share/cargo/bin/cargo-auto-test pulldown-cmark 0.8.0 --all-targets --no-default-features --features simd +Features: test-name=librust-pulldown-cmark-dev:simd +Depends: dh-cargo (>= 18), librust-html5ever-0.25+default-dev, librust-lazy-static-1+default-dev (>= 1.4-~~), librust-markup5ever-rcdom-0.1+default-dev, librust-regex-1+default-dev (>= 1.3-~~), librust-tendril-0.4+default-dev, @ +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test pulldown-cmark 0.8.0 --all-targets --no-default-features +Features: test-name=librust-pulldown-cmark-dev: +Depends: dh-cargo (>= 18), librust-html5ever-0.25+default-dev, librust-lazy-static-1+default-dev (>= 1.4-~~), librust-markup5ever-rcdom-0.1+default-dev, librust-regex-1+default-dev (>= 1.3-~~), librust-tendril-0.4+default-dev, @ +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test pulldown-cmark 0.8.0 --all-targets --no-default-features --features getopts +Features: test-name=librust-pulldown-cmark+default-dev:getopts +Depends: dh-cargo (>= 18), librust-html5ever-0.25+default-dev, librust-lazy-static-1+default-dev (>= 1.4-~~), librust-markup5ever-rcdom-0.1+default-dev, librust-regex-1+default-dev (>= 1.3-~~), librust-tendril-0.4+default-dev, @ +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test pulldown-cmark 0.8.0 --all-targets +Features: test-name=librust-pulldown-cmark+default-dev:default +Depends: dh-cargo (>= 18), librust-html5ever-0.25+default-dev, librust-lazy-static-1+default-dev (>= 1.4-~~), librust-markup5ever-rcdom-0.1+default-dev, librust-regex-1+default-dev (>= 1.3-~~), librust-tendril-0.4+default-dev, @ +Restrictions: allow-stderr, skip-not-installable diff -Nru rust-pulldown-cmark-0.2.0/debian/watch rust-pulldown-cmark-0.8.0/debian/watch --- rust-pulldown-cmark-0.2.0/debian/watch 2018-11-20 13:03:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/debian/watch 2021-09-03 20:44:41.000000000 +0000 @@ -2,4 +2,3 @@ opts=filenamemangle=s/.*\/(.*)\/download/pulldown-cmark-$1\.tar\.gz/g,\ uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ https://qa.debian.org/cgi-bin/fakeupstream.cgi?upstream=crates.io/pulldown-cmark .*/crates/pulldown-cmark/@ANY_VERSION@/download - diff -Nru rust-pulldown-cmark-0.2.0/examples/broken-link-callbacks.rs rust-pulldown-cmark-0.8.0/examples/broken-link-callbacks.rs --- rust-pulldown-cmark-0.2.0/examples/broken-link-callbacks.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/examples/broken-link-callbacks.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,37 @@ +extern crate pulldown_cmark; + +use pulldown_cmark::{html, BrokenLink, Options, Parser}; + +fn main() { + let input: &str = "Hello world, check out [my website][]."; + println!("Parsing the following markdown string:\n{}", input); + + // Setup callback that sets the URL and title when it encounters + // a reference to our home page. + let callback = &mut |broken_link: BrokenLink| { + if broken_link.reference == "my website" { + println!( + "Replacing the markdown `{}` of type {:?} with a working link", + &input[broken_link.span], broken_link.link_type, + ); + Some(("http://example.com".into(), "my example website".into())) + } else { + None + } + }; + + // Create a parser with our callback function for broken links. + let parser = Parser::new_with_broken_link_callback(input, Options::empty(), Some(callback)); + + // Write to String buffer. + let mut html_output: String = String::with_capacity(input.len() * 3 / 2); + html::push_html(&mut html_output, parser); + + // Check that the output is what we expected. + let expected_html: &str = + "

Hello world, check out my website.

\n"; + assert_eq!(expected_html, &html_output); + + // Write result to stdout. + println!("\nHTML output:\n{}", &html_output); +} diff -Nru rust-pulldown-cmark-0.2.0/examples/event-filter.rs rust-pulldown-cmark-0.8.0/examples/event-filter.rs --- rust-pulldown-cmark-0.2.0/examples/event-filter.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/examples/event-filter.rs 2020-08-21 13:57:35.000000000 +0000 @@ -0,0 +1,29 @@ +extern crate pulldown_cmark; + +use std::io::Write as _; + +use pulldown_cmark::{html, Event, Options, Parser, Tag}; + +fn main() { + let markdown_input: &str = "This is Peter on ![holiday in Greece](pearl_beach.jpg)."; + println!("Parsing the following markdown string:\n{}", markdown_input); + + // Set up parser. We can treat is as any other iterator. We replace Peter by John + // and image by its alt text. + let parser = Parser::new_ext(markdown_input, Options::empty()) + .map(|event| match event { + Event::Text(text) => Event::Text(text.replace("Peter", "John").into()), + _ => event, + }) + .filter(|event| match event { + Event::Start(Tag::Image(..)) | Event::End(Tag::Image(..)) => false, + _ => true, + }); + + // Write to anything implementing the `Write` trait. This could also be a file + // or network socket. + let stdout = std::io::stdout(); + let mut handle = stdout.lock(); + handle.write_all(b"\nHTML output:\n").unwrap(); + html::write_html(&mut handle, parser).unwrap(); +} diff -Nru rust-pulldown-cmark-0.2.0/examples/string-to-string.rs rust-pulldown-cmark-0.8.0/examples/string-to-string.rs --- rust-pulldown-cmark-0.2.0/examples/string-to-string.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/examples/string-to-string.rs 2020-08-21 13:57:35.000000000 +0000 @@ -0,0 +1,26 @@ +extern crate pulldown_cmark; + +use pulldown_cmark::{html, Options, Parser}; + +fn main() { + let markdown_input: &str = "Hello world, this is a ~~complicated~~ *very simple* example."; + println!("Parsing the following markdown string:\n{}", markdown_input); + + // Set up options and parser. Strikethroughs are not part of the CommonMark standard + // and we therefore must enable it explicitly. + let mut options = Options::empty(); + options.insert(Options::ENABLE_STRIKETHROUGH); + let parser = Parser::new_ext(markdown_input, options); + + // Write to String buffer. + let mut html_output: String = String::with_capacity(markdown_input.len() * 3 / 2); + html::push_html(&mut html_output, parser); + + // Check that the output is what we expected. + let expected_html: &str = + "

Hello world, this is a complicated very simple example.

\n"; + assert_eq!(expected_html, &html_output); + + // Write result to stdout. + println!("\nHTML output:\n{}", &html_output); +} diff -Nru rust-pulldown-cmark-0.2.0/README.md rust-pulldown-cmark-0.8.0/README.md --- rust-pulldown-cmark-0.2.0/README.md 2018-11-07 16:19:31.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/README.md 2020-09-01 15:22:39.000000000 +0000 @@ -1,5 +1,9 @@ # pulldown-cmark +[![Build Status](https://dev.azure.com/raphlinus/pulldown-cmark/_apis/build/status/pulldown-cmark-CI?branchName=master)](https://dev.azure.com/raphlinus/pulldown-cmark/_build/latest?definitionId=2&branchName=master) +[![Docs](https://docs.rs/pulldown-cmark/badge.svg)](https://docs.rs/pulldown-cmark) +[![Crates.io](https://img.shields.io/crates/v/pulldown-cmark.svg?maxAge=2592000)](https://crates.io/crates/pulldown-cmark) + [Documentation](https://docs.rs/pulldown-cmark/) This library is a pull parser for [CommonMark](http://commonmark.org/), written @@ -14,6 +18,13 @@ * Versatile; in particular source-maps are supported * Correct; the goal is 100% compliance with the [CommonMark spec](http://spec.commonmark.org/) +Further, it optionally supports parsing footnotes, +[Github flavored tables](https://github.github.com/gfm/#tables-extension-), +[Github flavored task lists](https://github.github.com/gfm/#task-list-items-extension-) and +[strikethrough](https://github.github.com/gfm/#strikethrough-extension-). + +Rustc 1.36 or newer is required to build the crate. + ## Why a pull parser? There are many parsers for Markdown and its variants, but to my knowledge none @@ -34,9 +45,11 @@ drive a push interface, also with minimal memory, and quite straightforward to construct an AST. Another advantage is that source-map information (the mapping between parsed blocks and offsets within the source text) is readily available; -you basically just call `get_offset()` as you consume events. +you can call `into_offset_iter()` to create an iterator that yields `(Event, Range)` +pairs, where the second element is the event's corresponding range in the source +document. -While manipulating AST's is the most flexible way to transform documents, +While manipulating ASTs is the most flexible way to transform documents, operating on iterators is surprisingly easy, and quite efficient. Here, for example, is the code to transform soft line breaks into hard breaks: @@ -51,7 +64,7 @@ ```rust let parser = parser.map(|event| match event { - Event::Text(text) => Event::Text(text.replace("abbr", "abbreviation")), + Event::Text(text) => Event::Text(text.replace("abbr", "abbreviation").into()), _ => event }); ``` @@ -73,6 +86,9 @@ } ``` +There are some basic but fully functional examples of the usage of the crate in the +`examples` directory of this repository. + ## Using Rust idiomatically A lot of the internal scanning code is written at a pretty low level (it @@ -86,15 +102,20 @@ for loops and `map` (as in the examples above), collecting the events into a vector (for recording, playback, and manipulation), and more. -Further, the `Text` event (representing text) is a copy-on-write string (note: -this isn't quite true yet). The vast majority of text fragments are just +Further, the `Text` event (representing text) is a small copy-on-write string. +The vast majority of text fragments are just slices of the source document. For these, copy-on-write gives a convenient representation that requires no allocation or copying, but allocated strings are available when they're needed. Thus, when rendering text to HTML, most text is copied just once, from the source document to the HTML buffer. -## Building only the pulldown-cmark library +When using the pulldown-cmark's own HTML renderer, make sure to write to a buffered +target like a `Vec` or `String`. Since it performs many (very) small writes, writing +directly to stdout, files, or sockets is detrimental to performance. Such writers can +be wrapped in a [`BufWriter`](https://doc.rust-lang.org/std/io/struct.BufWriter.html). + +## Build options By default, the binary is built as well. If you don't want/need it, then build like this: @@ -105,14 +126,27 @@ Or put in your `Cargo.toml` file: ```toml -pulldown-cmark = { version = "0.0.11", default-features = false } +pulldown-cmark = { version = "0.8", default-features = false } +``` + +SIMD accelerated scanners are available for the x64 platform from version 0.5 onwards. To +enable them, build with simd feature: + +```bash +> cargo build --release --features simd +``` + +Or add the feature to your project's `Cargo.toml`: + +```toml +pulldown-cmark = { version = "0.8", default-features = false, features = ["simd"] } ``` ## Authors -The main author is Raph Levien. +The main author is Raph Levien. The implementation of the new design (v0.3+) was completed by Marcus Klaas de Vries. ## Contributions We gladly accept contributions via GitHub pull requests. Please see -`CONTRIBUTIONS.md` for more details. +[CONTRIBUTING.md](CONTRIBUTING.md) for more details. diff -Nru rust-pulldown-cmark-0.2.0/specs/footnotes.txt rust-pulldown-cmark-0.8.0/specs/footnotes.txt --- rust-pulldown-cmark-0.2.0/specs/footnotes.txt 2018-11-05 23:35:36.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/specs/footnotes.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -Run this with `cargo run -- -F -s specs/footnotes.txt`. - -This is how footnotes are basically used. - -```````````````````````````````` example -Lorem ipsum.[^a] - -[^a]: Cool. -. -

Lorem ipsum.1

-
1 -

Cool.

-
-```````````````````````````````` - - -Footnotes can be used inside blockquotes: - -```````````````````````````````` example -> This is the song that never ends.\ -> Yes it goes on and on my friends.[^lambchops] -> -> [^lambchops]: -. -
-

This is the song that never ends.
-Yes it goes on and on my friends.1

- -
-```````````````````````````````` - - -Footnotes can be complex block structures: - -```````````````````````````````` example -Songs that simply loop are a popular way to annoy people. [^examples] - -[^examples]: - * [The song that never ends](https://www.youtube.com/watch?v=0U2zJOryHKQ) - * [I know a song that gets on everybody's nerves](https://www.youtube.com/watch?v=TehWI09qxls) - * [Ninety-nine bottles of beer on the wall](https://www.youtube.com/watch?v=qVjCag8XoHQ) -. -

Songs that simply loop are a popular way to annoy people. 1

- -```````````````````````````````` - - -Footnotes can even have multiple paragraphs. They also don't need to be referenced to show up. - -```````````````````````````````` example -[^lorem]: If heaven ever wishes to grant me a boon, it will be a total effacing of the results of a mere chance which fixed my eye on a certain stray piece of shelf-paper. It was nothing on which I would naturally have stumbled in the course of my daily round, for it was an old number of an Australian journal, the Sydney Bulletin for April 18, 1925. It had escaped even the cutting bureau which had at the time of its issuance been avidly collecting material for my uncle's research. - -I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp. -. -
1 -

If heaven ever wishes to grant me a boon, it will be a total effacing of the results of a mere chance which fixed my eye on a certain stray piece of shelf-paper. It was nothing on which I would naturally have stumbled in the course of my daily round, for it was an old number of an Australian journal, the Sydney Bulletin for April 18, 1925. It had escaped even the cutting bureau which had at the time of its issuance been avidly collecting material for my uncle's research.

-
-

I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp.

-```````````````````````````````` - - -A footnote will end on a single line break. Note that this behavior changed in version -0.1.0, to become more like hoedown. See issue #21. - -```````````````````````````````` example -[^ipsum]: How much wood would a woodchuck chuck. - -If a woodchuck could chuck wood. - - -# Forms of entertainment that aren't childish -. -
1 -

How much wood would a woodchuck chuck.

-
-

If a woodchuck could chuck wood.

-

Forms of entertainment that aren't childish

-```````````````````````````````` - - -A footnote will also break if it's inside another container. - -```````````````````````````````` example -> He's also really stupid. [^why] -> -> [^why]: Because your mamma! - -As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet. -. -
-

He's also really stupid. 1

-
1 -

Because your mamma!

-
-
-

As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

-```````````````````````````````` - - -As a special exception, footnotes cannot be nested directly inside each other. - -```````````````````````````````` example -Nested footnotes are considered poor style. [^a] [^xkcd] - -[^a]: This does not mean that footnotes cannot reference each other. [^b] - -[^b]: This means that a footnote definition cannot be directly inside another footnote definition. -> This means that a footnote cannot be directly inside another footnote's body. [^e] -> -> [^e]: They can, however, be inside anything else. - -[^xkcd]: [The other kind of nested footnote is, however, considered poor style.](https://xkcd.com/1208/) -. -

Nested footnotes are considered poor style. 1 2

-
1 -

This does not mean that footnotes cannot reference each other. 3

-
-
3 -

This means that a footnote definition cannot be directly inside another footnote definition.

-
-

This means that a footnote cannot be directly inside another footnote's body. 4

-
4 -

They can, however, be inside anything else.

-
-
-
- -```````````````````````````````` - -They do need one line between each other. - -```````````````````````````````` example -[^Doh] Ray Me Fa So La Te Do! [^1] - -[^Doh]: I know. Wrong Doe. And it won't render right. -[^1]: Common for people practicing music. -. -

1 Ray Me Fa So La Te Do! 2

-
1 -

I know. Wrong Doe. And it won't render right. -2: Common for people practicing music.

-
-```````````````````````````````` diff -Nru rust-pulldown-cmark-0.2.0/specs/table.txt rust-pulldown-cmark-0.8.0/specs/table.txt --- rust-pulldown-cmark-0.2.0/specs/table.txt 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/specs/table.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -Run this with `cargo run -- -T -s specs/table.txt`. - -False match -=========== - -```````````````````````````````` example -Test header ------------ -. -

Test header

-```````````````````````````````` - - -True match -========== - -```````````````````````````````` example -Test|Table -----|----- -. - -
TestTable
-```````````````````````````````` - - -Actual rows in it -================= - -```````````````````````````````` example -Test|Table -----|----- -Test row -Test|2 - -Test ending -. - - - -
TestTable
Test row
Test2
-

Test ending

-```````````````````````````````` - - -Test with quote -=============== - -```````````````````````````````` example -> Test | Table -> ------|------ -> Row 1 | Every -> Row 2 | Day -> -> Paragraph -. -
- - - -
Test Table
Row 1 Every
Row 2 Day
-

Paragraph

-
-```````````````````````````````` - - -Test with list -============== - -```````````````````````````````` example - 1. First entry - 2. Second entry - - Col 1|Col 2 - -|- - Row 1|Part 2 - Row 2|Part 2 -. -
    -
  1. -

    First entry

    -
  2. -
  3. -

    Second entry

    - - - -
    Col 1Col 2
    Row 1Part 2
    Row 2Part 2
    -
  4. -
-```````````````````````````````` - - -Test with border -================ - -```````````````````````````````` example -|Col 1|Col 2| -|-----|-----| -|R1C1 |R1C2 | -|R2C1 |R2C2 | -. - - - -
Col 1Col 2
R1C1 R1C2
R2C1 R2C2
-```````````````````````````````` - - -Test with empty cells -===================== - -Empty cells should work. - -```````````````````````````````` example -| Col 1 | Col 2 | -|-------|-------| -| | | -| | | -. - - - -
Col 1 Col 2
-```````````````````````````````` - -... and properly mix with filled cells. - -```````````````````````````````` example -| Col 1 | Col 2 | -|-------|-------| -| x | | -| | x | -. - - - -
Col 1 Col 2
x
x
-```````````````````````````````` - - -Table with UTF-8 -================ - -Basic example. - -```````````````````````````````` example -|Col 1|Col 2| -|-----|-----| -|✓ |✓ | -|✓ |✓ | -. - - - -
Col 1Col 2
-```````````````````````````````` - -More advanced example. - -```````````````````````````````` example -| Target | std |rustc|cargo| notes | -|-------------------------------|-----|-----|-----|----------------------------| -| `x86_64-unknown-linux-musl` | ✓ | | | 64-bit Linux with MUSL | -| `arm-linux-androideabi` | ✓ | | | ARM Android | -| `arm-unknown-linux-gnueabi` | ✓ | ✓ | | ARM Linux (2.6.18+) | -| `arm-unknown-linux-gnueabihf` | ✓ | ✓ | | ARM Linux (2.6.18+) | -| `aarch64-unknown-linux-gnu` | ✓ | | | ARM64 Linux (2.6.18+) | -| `mips-unknown-linux-gnu` | ✓ | | | MIPS Linux (2.6.18+) | -| `mipsel-unknown-linux-gnu` | ✓ | | | MIPS (LE) Linux (2.6.18+) | -. - - - - - - - - -
Target std rustccargo notes
x86_64-unknown-linux-musl 64-bit Linux with MUSL
arm-linux-androideabi ARM Android
arm-unknown-linux-gnueabi ARM Linux (2.6.18+)
arm-unknown-linux-gnueabihf ARM Linux (2.6.18+)
aarch64-unknown-linux-gnu ARM64 Linux (2.6.18+)
mips-unknown-linux-gnu MIPS Linux (2.6.18+)
mipsel-unknown-linux-gnu MIPS (LE) Linux (2.6.18+)
-```````````````````````````````` - -Hiragana-containing pseudo-table. - -```````````````````````````````` example -|-|-| -|ぃ|い| -. -

|-|-| -|ぃ|い|

-```````````````````````````````` - -Hiragana-containing actual table. - -```````````````````````````````` example -|ぁ|ぃ| -|-|-| -|ぃ|ぃ| -. - - -
-```````````````````````````````` - -Test russian symbols. - -```````````````````````````````` example -|Колонка 1|Колонка 2| -|---------|---------| -|Ячейка 1 |Ячейка 2 | -. - - -
Колонка 1Колонка 2
Ячейка 1 Ячейка 2
-```````````````````````````````` diff -Nru rust-pulldown-cmark-0.2.0/src/entities.rs rust-pulldown-cmark-0.8.0/src/entities.rs --- rust-pulldown-cmark-0.2.0/src/entities.rs 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/entities.rs 2020-08-21 13:57:35.000000000 +0000 @@ -22,4263 +22,2137 @@ // Autogenerated by mk_entities.py -const ENTITIES: [&'static str; 2125] = [ - "AElig", - "AMP", - "Aacute", - "Abreve", - "Acirc", - "Acy", - "Afr", - "Agrave", - "Alpha", - "Amacr", - "And", - "Aogon", - "Aopf", - "ApplyFunction", - "Aring", - "Ascr", - "Assign", - "Atilde", - "Auml", - "Backslash", - "Barv", - "Barwed", - "Bcy", - "Because", - "Bernoullis", - "Beta", - "Bfr", - "Bopf", - "Breve", - "Bscr", - "Bumpeq", - "CHcy", - "COPY", - "Cacute", - "Cap", - "CapitalDifferentialD", - "Cayleys", - "Ccaron", - "Ccedil", - "Ccirc", - "Cconint", - "Cdot", - "Cedilla", - "CenterDot", - "Cfr", - "Chi", - "CircleDot", - "CircleMinus", - "CirclePlus", - "CircleTimes", - "ClockwiseContourIntegral", - "CloseCurlyDoubleQuote", - "CloseCurlyQuote", - "Colon", - "Colone", - "Congruent", - "Conint", - "ContourIntegral", - "Copf", - "Coproduct", - "CounterClockwiseContourIntegral", - "Cross", - "Cscr", - "Cup", - "CupCap", - "DD", - "DDotrahd", - "DJcy", - "DScy", - "DZcy", - "Dagger", - "Darr", - "Dashv", - "Dcaron", - "Dcy", - "Del", - "Delta", - "Dfr", - "DiacriticalAcute", - "DiacriticalDot", - "DiacriticalDoubleAcute", - "DiacriticalGrave", - "DiacriticalTilde", - "Diamond", - "DifferentialD", - "Dopf", - "Dot", - "DotDot", - "DotEqual", - "DoubleContourIntegral", - "DoubleDot", - "DoubleDownArrow", - "DoubleLeftArrow", - "DoubleLeftRightArrow", - "DoubleLeftTee", - "DoubleLongLeftArrow", - "DoubleLongLeftRightArrow", - "DoubleLongRightArrow", - "DoubleRightArrow", - "DoubleRightTee", - "DoubleUpArrow", - "DoubleUpDownArrow", - "DoubleVerticalBar", - "DownArrow", - "DownArrowBar", - "DownArrowUpArrow", - "DownBreve", - "DownLeftRightVector", - "DownLeftTeeVector", - "DownLeftVector", - "DownLeftVectorBar", - "DownRightTeeVector", - "DownRightVector", - "DownRightVectorBar", - "DownTee", - "DownTeeArrow", - "Downarrow", - "Dscr", - "Dstrok", - "ENG", - "ETH", - "Eacute", - "Ecaron", - "Ecirc", - "Ecy", - "Edot", - "Efr", - "Egrave", - "Element", - "Emacr", - "EmptySmallSquare", - "EmptyVerySmallSquare", - "Eogon", - "Eopf", - "Epsilon", - "Equal", - "EqualTilde", - "Equilibrium", - "Escr", - "Esim", - "Eta", - "Euml", - "Exists", - "ExponentialE", - "Fcy", - "Ffr", - "FilledSmallSquare", - "FilledVerySmallSquare", - "Fopf", - "ForAll", - "Fouriertrf", - "Fscr", - "GJcy", - "GT", - "Gamma", - "Gammad", - "Gbreve", - "Gcedil", - "Gcirc", - "Gcy", - "Gdot", - "Gfr", - "Gg", - "Gopf", - "GreaterEqual", - "GreaterEqualLess", - "GreaterFullEqual", - "GreaterGreater", - "GreaterLess", - "GreaterSlantEqual", - "GreaterTilde", - "Gscr", - "Gt", - "HARDcy", - "Hacek", - "Hat", - "Hcirc", - "Hfr", - "HilbertSpace", - "Hopf", - "HorizontalLine", - "Hscr", - "Hstrok", - "HumpDownHump", - "HumpEqual", - "IEcy", - "IJlig", - "IOcy", - "Iacute", - "Icirc", - "Icy", - "Idot", - "Ifr", - "Igrave", - "Im", - "Imacr", - "ImaginaryI", - "Implies", - "Int", - "Integral", - "Intersection", - "InvisibleComma", - "InvisibleTimes", - "Iogon", - "Iopf", - "Iota", - "Iscr", - "Itilde", - "Iukcy", - "Iuml", - "Jcirc", - "Jcy", - "Jfr", - "Jopf", - "Jscr", - "Jsercy", - "Jukcy", - "KHcy", - "KJcy", - "Kappa", - "Kcedil", - "Kcy", - "Kfr", - "Kopf", - "Kscr", - "LJcy", - "LT", - "Lacute", - "Lambda", - "Lang", - "Laplacetrf", - "Larr", - "Lcaron", - "Lcedil", - "Lcy", - "LeftAngleBracket", - "LeftArrow", - "LeftArrowBar", - "LeftArrowRightArrow", - "LeftCeiling", - "LeftDoubleBracket", - "LeftDownTeeVector", - "LeftDownVector", - "LeftDownVectorBar", - "LeftFloor", - "LeftRightArrow", - "LeftRightVector", - "LeftTee", - "LeftTeeArrow", - "LeftTeeVector", - "LeftTriangle", - "LeftTriangleBar", - "LeftTriangleEqual", - "LeftUpDownVector", - "LeftUpTeeVector", - "LeftUpVector", - "LeftUpVectorBar", - "LeftVector", - "LeftVectorBar", - "Leftarrow", - "Leftrightarrow", - "LessEqualGreater", - "LessFullEqual", - "LessGreater", - "LessLess", - "LessSlantEqual", - "LessTilde", - "Lfr", - "Ll", - "Lleftarrow", - "Lmidot", - "LongLeftArrow", - "LongLeftRightArrow", - "LongRightArrow", - "Longleftarrow", - "Longleftrightarrow", - "Longrightarrow", - "Lopf", - "LowerLeftArrow", - "LowerRightArrow", - "Lscr", - "Lsh", - "Lstrok", - "Lt", - "Map", - "Mcy", - "MediumSpace", - "Mellintrf", - "Mfr", - "MinusPlus", - "Mopf", - "Mscr", - "Mu", - "NJcy", - "Nacute", - "Ncaron", - "Ncedil", - "Ncy", - "NegativeMediumSpace", - "NegativeThickSpace", - "NegativeThinSpace", - "NegativeVeryThinSpace", - "NestedGreaterGreater", - "NestedLessLess", - "NewLine", - "Nfr", - "NoBreak", - "NonBreakingSpace", - "Nopf", - "Not", - "NotCongruent", - "NotCupCap", - "NotDoubleVerticalBar", - "NotElement", - "NotEqual", - "NotEqualTilde", - "NotExists", - "NotGreater", - "NotGreaterEqual", - "NotGreaterFullEqual", - "NotGreaterGreater", - "NotGreaterLess", - "NotGreaterSlantEqual", - "NotGreaterTilde", - "NotHumpDownHump", - "NotHumpEqual", - "NotLeftTriangle", - "NotLeftTriangleBar", - "NotLeftTriangleEqual", - "NotLess", - "NotLessEqual", - "NotLessGreater", - "NotLessLess", - "NotLessSlantEqual", - "NotLessTilde", - "NotNestedGreaterGreater", - "NotNestedLessLess", - "NotPrecedes", - "NotPrecedesEqual", - "NotPrecedesSlantEqual", - "NotReverseElement", - "NotRightTriangle", - "NotRightTriangleBar", - "NotRightTriangleEqual", - "NotSquareSubset", - "NotSquareSubsetEqual", - "NotSquareSuperset", - "NotSquareSupersetEqual", - "NotSubset", - "NotSubsetEqual", - "NotSucceeds", - "NotSucceedsEqual", - "NotSucceedsSlantEqual", - "NotSucceedsTilde", - "NotSuperset", - "NotSupersetEqual", - "NotTilde", - "NotTildeEqual", - "NotTildeFullEqual", - "NotTildeTilde", - "NotVerticalBar", - "Nscr", - "Ntilde", - "Nu", - "OElig", - "Oacute", - "Ocirc", - "Ocy", - "Odblac", - "Ofr", - "Ograve", - "Omacr", - "Omega", - "Omicron", - "Oopf", - "OpenCurlyDoubleQuote", - "OpenCurlyQuote", - "Or", - "Oscr", - "Oslash", - "Otilde", - "Otimes", - "Ouml", - "OverBar", - "OverBrace", - "OverBracket", - "OverParenthesis", - "PartialD", - "Pcy", - "Pfr", - "Phi", - "Pi", - "PlusMinus", - "Poincareplane", - "Popf", - "Pr", - "Precedes", - "PrecedesEqual", - "PrecedesSlantEqual", - "PrecedesTilde", - "Prime", - "Product", - "Proportion", - "Proportional", - "Pscr", - "Psi", - "QUOT", - "Qfr", - "Qopf", - "Qscr", - "RBarr", - "REG", - "Racute", - "Rang", - "Rarr", - "Rarrtl", - "Rcaron", - "Rcedil", - "Rcy", - "Re", - "ReverseElement", - "ReverseEquilibrium", - "ReverseUpEquilibrium", - "Rfr", - "Rho", - "RightAngleBracket", - "RightArrow", - "RightArrowBar", - "RightArrowLeftArrow", - "RightCeiling", - "RightDoubleBracket", - "RightDownTeeVector", - "RightDownVector", - "RightDownVectorBar", - "RightFloor", - "RightTee", - "RightTeeArrow", - "RightTeeVector", - "RightTriangle", - "RightTriangleBar", - "RightTriangleEqual", - "RightUpDownVector", - "RightUpTeeVector", - "RightUpVector", - "RightUpVectorBar", - "RightVector", - "RightVectorBar", - "Rightarrow", - "Ropf", - "RoundImplies", - "Rrightarrow", - "Rscr", - "Rsh", - "RuleDelayed", - "SHCHcy", - "SHcy", - "SOFTcy", - "Sacute", - "Sc", - "Scaron", - "Scedil", - "Scirc", - "Scy", - "Sfr", - "ShortDownArrow", - "ShortLeftArrow", - "ShortRightArrow", - "ShortUpArrow", - "Sigma", - "SmallCircle", - "Sopf", - "Sqrt", - "Square", - "SquareIntersection", - "SquareSubset", - "SquareSubsetEqual", - "SquareSuperset", - "SquareSupersetEqual", - "SquareUnion", - "Sscr", - "Star", - "Sub", - "Subset", - "SubsetEqual", - "Succeeds", - "SucceedsEqual", - "SucceedsSlantEqual", - "SucceedsTilde", - "SuchThat", - "Sum", - "Sup", - "Superset", - "SupersetEqual", - "Supset", - "THORN", - "TRADE", - "TSHcy", - "TScy", - "Tab", - "Tau", - "Tcaron", - "Tcedil", - "Tcy", - "Tfr", - "Therefore", - "Theta", - "ThickSpace", - "ThinSpace", - "Tilde", - "TildeEqual", - "TildeFullEqual", - "TildeTilde", - "Topf", - "TripleDot", - "Tscr", - "Tstrok", - "Uacute", - "Uarr", - "Uarrocir", - "Ubrcy", - "Ubreve", - "Ucirc", - "Ucy", - "Udblac", - "Ufr", - "Ugrave", - "Umacr", - "UnderBar", - "UnderBrace", - "UnderBracket", - "UnderParenthesis", - "Union", - "UnionPlus", - "Uogon", - "Uopf", - "UpArrow", - "UpArrowBar", - "UpArrowDownArrow", - "UpDownArrow", - "UpEquilibrium", - "UpTee", - "UpTeeArrow", - "Uparrow", - "Updownarrow", - "UpperLeftArrow", - "UpperRightArrow", - "Upsi", - "Upsilon", - "Uring", - "Uscr", - "Utilde", - "Uuml", - "VDash", - "Vbar", - "Vcy", - "Vdash", - "Vdashl", - "Vee", - "Verbar", - "Vert", - "VerticalBar", - "VerticalLine", - "VerticalSeparator", - "VerticalTilde", - "VeryThinSpace", - "Vfr", - "Vopf", - "Vscr", - "Vvdash", - "Wcirc", - "Wedge", - "Wfr", - "Wopf", - "Wscr", - "Xfr", - "Xi", - "Xopf", - "Xscr", - "YAcy", - "YIcy", - "YUcy", - "Yacute", - "Ycirc", - "Ycy", - "Yfr", - "Yopf", - "Yscr", - "Yuml", - "ZHcy", - "Zacute", - "Zcaron", - "Zcy", - "Zdot", - "ZeroWidthSpace", - "Zeta", - "Zfr", - "Zopf", - "Zscr", - "aacute", - "abreve", - "ac", - "acE", - "acd", - "acirc", - "acute", - "acy", - "aelig", - "af", - "afr", - "agrave", - "alefsym", - "aleph", - "alpha", - "amacr", - "amalg", - "amp", - "and", - "andand", - "andd", - "andslope", - "andv", - "ang", - "ange", - "angle", - "angmsd", - "angmsdaa", - "angmsdab", - "angmsdac", - "angmsdad", - "angmsdae", - "angmsdaf", - "angmsdag", - "angmsdah", - "angrt", - "angrtvb", - "angrtvbd", - "angsph", - "angst", - "angzarr", - "aogon", - "aopf", - "ap", - "apE", - "apacir", - "ape", - "apid", - "apos", - "approx", - "approxeq", - "aring", - "ascr", - "ast", - "asymp", - "asympeq", - "atilde", - "auml", - "awconint", - "awint", - "bNot", - "backcong", - "backepsilon", - "backprime", - "backsim", - "backsimeq", - "barvee", - "barwed", - "barwedge", - "bbrk", - "bbrktbrk", - "bcong", - "bcy", - "bdquo", - "becaus", - "because", - "bemptyv", - "bepsi", - "bernou", - "beta", - "beth", - "between", - "bfr", - "bigcap", - "bigcirc", - "bigcup", - "bigodot", - "bigoplus", - "bigotimes", - "bigsqcup", - "bigstar", - "bigtriangledown", - "bigtriangleup", - "biguplus", - "bigvee", - "bigwedge", - "bkarow", - "blacklozenge", - "blacksquare", - "blacktriangle", - "blacktriangledown", - "blacktriangleleft", - "blacktriangleright", - "blank", - "blk12", - "blk14", - "blk34", - "block", - "bne", - "bnequiv", - "bnot", - "bopf", - "bot", - "bottom", - "bowtie", - "boxDL", - "boxDR", - "boxDl", - "boxDr", - "boxH", - "boxHD", - "boxHU", - "boxHd", - "boxHu", - "boxUL", - "boxUR", - "boxUl", - "boxUr", - "boxV", - "boxVH", - "boxVL", - "boxVR", - "boxVh", - "boxVl", - "boxVr", - "boxbox", - "boxdL", - "boxdR", - "boxdl", - "boxdr", - "boxh", - "boxhD", - "boxhU", - "boxhd", - "boxhu", - "boxminus", - "boxplus", - "boxtimes", - "boxuL", - "boxuR", - "boxul", - "boxur", - "boxv", - "boxvH", - "boxvL", - "boxvR", - "boxvh", - "boxvl", - "boxvr", - "bprime", - "breve", - "brvbar", - "bscr", - "bsemi", - "bsim", - "bsime", - "bsol", - "bsolb", - "bsolhsub", - "bull", - "bullet", - "bump", - "bumpE", - "bumpe", - "bumpeq", - "cacute", - "cap", - "capand", - "capbrcup", - "capcap", - "capcup", - "capdot", - "caps", - "caret", - "caron", - "ccaps", - "ccaron", - "ccedil", - "ccirc", - "ccups", - "ccupssm", - "cdot", - "cedil", - "cemptyv", - "cent", - "centerdot", - "cfr", - "chcy", - "check", - "checkmark", - "chi", - "cir", - "cirE", - "circ", - "circeq", - "circlearrowleft", - "circlearrowright", - "circledR", - "circledS", - "circledast", - "circledcirc", - "circleddash", - "cire", - "cirfnint", - "cirmid", - "cirscir", - "clubs", - "clubsuit", - "colon", - "colone", - "coloneq", - "comma", - "commat", - "comp", - "compfn", - "complement", - "complexes", - "cong", - "congdot", - "conint", - "copf", - "coprod", - "copy", - "copysr", - "crarr", - "cross", - "cscr", - "csub", - "csube", - "csup", - "csupe", - "ctdot", - "cudarrl", - "cudarrr", - "cuepr", - "cuesc", - "cularr", - "cularrp", - "cup", - "cupbrcap", - "cupcap", - "cupcup", - "cupdot", - "cupor", - "cups", - "curarr", - "curarrm", - "curlyeqprec", - "curlyeqsucc", - "curlyvee", - "curlywedge", - "curren", - "curvearrowleft", - "curvearrowright", - "cuvee", - "cuwed", - "cwconint", - "cwint", - "cylcty", - "dArr", - "dHar", - "dagger", - "daleth", - "darr", - "dash", - "dashv", - "dbkarow", - "dblac", - "dcaron", - "dcy", - "dd", - "ddagger", - "ddarr", - "ddotseq", - "deg", - "delta", - "demptyv", - "dfisht", - "dfr", - "dharl", - "dharr", - "diam", - "diamond", - "diamondsuit", - "diams", - "die", - "digamma", - "disin", - "div", - "divide", - "divideontimes", - "divonx", - "djcy", - "dlcorn", - "dlcrop", - "dollar", - "dopf", - "dot", - "doteq", - "doteqdot", - "dotminus", - "dotplus", - "dotsquare", - "doublebarwedge", - "downarrow", - "downdownarrows", - "downharpoonleft", - "downharpoonright", - "drbkarow", - "drcorn", - "drcrop", - "dscr", - "dscy", - "dsol", - "dstrok", - "dtdot", - "dtri", - "dtrif", - "duarr", - "duhar", - "dwangle", - "dzcy", - "dzigrarr", - "eDDot", - "eDot", - "eacute", - "easter", - "ecaron", - "ecir", - "ecirc", - "ecolon", - "ecy", - "edot", - "ee", - "efDot", - "efr", - "eg", - "egrave", - "egs", - "egsdot", - "el", - "elinters", - "ell", - "els", - "elsdot", - "emacr", - "empty", - "emptyset", - "emptyv", - "emsp", - "emsp13", - "emsp14", - "eng", - "ensp", - "eogon", - "eopf", - "epar", - "eparsl", - "eplus", - "epsi", - "epsilon", - "epsiv", - "eqcirc", - "eqcolon", - "eqsim", - "eqslantgtr", - "eqslantless", - "equals", - "equest", - "equiv", - "equivDD", - "eqvparsl", - "erDot", - "erarr", - "escr", - "esdot", - "esim", - "eta", - "eth", - "euml", - "euro", - "excl", - "exist", - "expectation", - "exponentiale", - "fallingdotseq", - "fcy", - "female", - "ffilig", - "fflig", - "ffllig", - "ffr", - "filig", - "fjlig", - "flat", - "fllig", - "fltns", - "fnof", - "fopf", - "forall", - "fork", - "forkv", - "fpartint", - "frac12", - "frac13", - "frac14", - "frac15", - "frac16", - "frac18", - "frac23", - "frac25", - "frac34", - "frac35", - "frac38", - "frac45", - "frac56", - "frac58", - "frac78", - "frasl", - "frown", - "fscr", - "gE", - "gEl", - "gacute", - "gamma", - "gammad", - "gap", - "gbreve", - "gcirc", - "gcy", - "gdot", - "ge", - "gel", - "geq", - "geqq", - "geqslant", - "ges", - "gescc", - "gesdot", - "gesdoto", - "gesdotol", - "gesl", - "gesles", - "gfr", - "gg", - "ggg", - "gimel", - "gjcy", - "gl", - "glE", - "gla", - "glj", - "gnE", - "gnap", - "gnapprox", - "gne", - "gneq", - "gneqq", - "gnsim", - "gopf", - "grave", - "gscr", - "gsim", - "gsime", - "gsiml", - "gt", - "gtcc", - "gtcir", - "gtdot", - "gtlPar", - "gtquest", - "gtrapprox", - "gtrarr", - "gtrdot", - "gtreqless", - "gtreqqless", - "gtrless", - "gtrsim", - "gvertneqq", - "gvnE", - "hArr", - "hairsp", - "half", - "hamilt", - "hardcy", - "harr", - "harrcir", - "harrw", - "hbar", - "hcirc", - "hearts", - "heartsuit", - "hellip", - "hercon", - "hfr", - "hksearow", - "hkswarow", - "hoarr", - "homtht", - "hookleftarrow", - "hookrightarrow", - "hopf", - "horbar", - "hscr", - "hslash", - "hstrok", - "hybull", - "hyphen", - "iacute", - "ic", - "icirc", - "icy", - "iecy", - "iexcl", - "iff", - "ifr", - "igrave", - "ii", - "iiiint", - "iiint", - "iinfin", - "iiota", - "ijlig", - "imacr", - "image", - "imagline", - "imagpart", - "imath", - "imof", - "imped", - "in", - "incare", - "infin", - "infintie", - "inodot", - "int", - "intcal", - "integers", - "intercal", - "intlarhk", - "intprod", - "iocy", - "iogon", - "iopf", - "iota", - "iprod", - "iquest", - "iscr", - "isin", - "isinE", - "isindot", - "isins", - "isinsv", - "isinv", - "it", - "itilde", - "iukcy", - "iuml", - "jcirc", - "jcy", - "jfr", - "jmath", - "jopf", - "jscr", - "jsercy", - "jukcy", - "kappa", - "kappav", - "kcedil", - "kcy", - "kfr", - "kgreen", - "khcy", - "kjcy", - "kopf", - "kscr", - "lAarr", - "lArr", - "lAtail", - "lBarr", - "lE", - "lEg", - "lHar", - "lacute", - "laemptyv", - "lagran", - "lambda", - "lang", - "langd", - "langle", - "lap", - "laquo", - "larr", - "larrb", - "larrbfs", - "larrfs", - "larrhk", - "larrlp", - "larrpl", - "larrsim", - "larrtl", - "lat", - "latail", - "late", - "lates", - "lbarr", - "lbbrk", - "lbrace", - "lbrack", - "lbrke", - "lbrksld", - "lbrkslu", - "lcaron", - "lcedil", - "lceil", - "lcub", - "lcy", - "ldca", - "ldquo", - "ldquor", - "ldrdhar", - "ldrushar", - "ldsh", - "le", - "leftarrow", - "leftarrowtail", - "leftharpoondown", - "leftharpoonup", - "leftleftarrows", - "leftrightarrow", - "leftrightarrows", - "leftrightharpoons", - "leftrightsquigarrow", - "leftthreetimes", - "leg", - "leq", - "leqq", - "leqslant", - "les", - "lescc", - "lesdot", - "lesdoto", - "lesdotor", - "lesg", - "lesges", - "lessapprox", - "lessdot", - "lesseqgtr", - "lesseqqgtr", - "lessgtr", - "lesssim", - "lfisht", - "lfloor", - "lfr", - "lg", - "lgE", - "lhard", - "lharu", - "lharul", - "lhblk", - "ljcy", - "ll", - "llarr", - "llcorner", - "llhard", - "lltri", - "lmidot", - "lmoust", - "lmoustache", - "lnE", - "lnap", - "lnapprox", - "lne", - "lneq", - "lneqq", - "lnsim", - "loang", - "loarr", - "lobrk", - "longleftarrow", - "longleftrightarrow", - "longmapsto", - "longrightarrow", - "looparrowleft", - "looparrowright", - "lopar", - "lopf", - "loplus", - "lotimes", - "lowast", - "lowbar", - "loz", - "lozenge", - "lozf", - "lpar", - "lparlt", - "lrarr", - "lrcorner", - "lrhar", - "lrhard", - "lrm", - "lrtri", - "lsaquo", - "lscr", - "lsh", - "lsim", - "lsime", - "lsimg", - "lsqb", - "lsquo", - "lsquor", - "lstrok", - "lt", - "ltcc", - "ltcir", - "ltdot", - "lthree", - "ltimes", - "ltlarr", - "ltquest", - "ltrPar", - "ltri", - "ltrie", - "ltrif", - "lurdshar", - "luruhar", - "lvertneqq", - "lvnE", - "mDDot", - "macr", - "male", - "malt", - "maltese", - "map", - "mapsto", - "mapstodown", - "mapstoleft", - "mapstoup", - "marker", - "mcomma", - "mcy", - "mdash", - "measuredangle", - "mfr", - "mho", - "micro", - "mid", - "midast", - "midcir", - "middot", - "minus", - "minusb", - "minusd", - "minusdu", - "mlcp", - "mldr", - "mnplus", - "models", - "mopf", - "mp", - "mscr", - "mstpos", - "mu", - "multimap", - "mumap", - "nGg", - "nGt", - "nGtv", - "nLeftarrow", - "nLeftrightarrow", - "nLl", - "nLt", - "nLtv", - "nRightarrow", - "nVDash", - "nVdash", - "nabla", - "nacute", - "nang", - "nap", - "napE", - "napid", - "napos", - "napprox", - "natur", - "natural", - "naturals", - "nbsp", - "nbump", - "nbumpe", - "ncap", - "ncaron", - "ncedil", - "ncong", - "ncongdot", - "ncup", - "ncy", - "ndash", - "ne", - "neArr", - "nearhk", - "nearr", - "nearrow", - "nedot", - "nequiv", - "nesear", - "nesim", - "nexist", - "nexists", - "nfr", - "ngE", - "nge", - "ngeq", - "ngeqq", - "ngeqslant", - "nges", - "ngsim", - "ngt", - "ngtr", - "nhArr", - "nharr", - "nhpar", - "ni", - "nis", - "nisd", - "niv", - "njcy", - "nlArr", - "nlE", - "nlarr", - "nldr", - "nle", - "nleftarrow", - "nleftrightarrow", - "nleq", - "nleqq", - "nleqslant", - "nles", - "nless", - "nlsim", - "nlt", - "nltri", - "nltrie", - "nmid", - "nopf", - "not", - "notin", - "notinE", - "notindot", - "notinva", - "notinvb", - "notinvc", - "notni", - "notniva", - "notnivb", - "notnivc", - "npar", - "nparallel", - "nparsl", - "npart", - "npolint", - "npr", - "nprcue", - "npre", - "nprec", - "npreceq", - "nrArr", - "nrarr", - "nrarrc", - "nrarrw", - "nrightarrow", - "nrtri", - "nrtrie", - "nsc", - "nsccue", - "nsce", - "nscr", - "nshortmid", - "nshortparallel", - "nsim", - "nsime", - "nsimeq", - "nsmid", - "nspar", - "nsqsube", - "nsqsupe", - "nsub", - "nsubE", - "nsube", - "nsubset", - "nsubseteq", - "nsubseteqq", - "nsucc", - "nsucceq", - "nsup", - "nsupE", - "nsupe", - "nsupset", - "nsupseteq", - "nsupseteqq", - "ntgl", - "ntilde", - "ntlg", - "ntriangleleft", - "ntrianglelefteq", - "ntriangleright", - "ntrianglerighteq", - "nu", - "num", - "numero", - "numsp", - "nvDash", - "nvHarr", - "nvap", - "nvdash", - "nvge", - "nvgt", - "nvinfin", - "nvlArr", - "nvle", - "nvlt", - "nvltrie", - "nvrArr", - "nvrtrie", - "nvsim", - "nwArr", - "nwarhk", - "nwarr", - "nwarrow", - "nwnear", - "oS", - "oacute", - "oast", - "ocir", - "ocirc", - "ocy", - "odash", - "odblac", - "odiv", - "odot", - "odsold", - "oelig", - "ofcir", - "ofr", - "ogon", - "ograve", - "ogt", - "ohbar", - "ohm", - "oint", - "olarr", - "olcir", - "olcross", - "oline", - "olt", - "omacr", - "omega", - "omicron", - "omid", - "ominus", - "oopf", - "opar", - "operp", - "oplus", - "or", - "orarr", - "ord", - "order", - "orderof", - "ordf", - "ordm", - "origof", - "oror", - "orslope", - "orv", - "oscr", - "oslash", - "osol", - "otilde", - "otimes", - "otimesas", - "ouml", - "ovbar", - "par", - "para", - "parallel", - "parsim", - "parsl", - "part", - "pcy", - "percnt", - "period", - "permil", - "perp", - "pertenk", - "pfr", - "phi", - "phiv", - "phmmat", - "phone", - "pi", - "pitchfork", - "piv", - "planck", - "planckh", - "plankv", - "plus", - "plusacir", - "plusb", - "pluscir", - "plusdo", - "plusdu", - "pluse", - "plusmn", - "plussim", - "plustwo", - "pm", - "pointint", - "popf", - "pound", - "pr", - "prE", - "prap", - "prcue", - "pre", - "prec", - "precapprox", - "preccurlyeq", - "preceq", - "precnapprox", - "precneqq", - "precnsim", - "precsim", - "prime", - "primes", - "prnE", - "prnap", - "prnsim", - "prod", - "profalar", - "profline", - "profsurf", - "prop", - "propto", - "prsim", - "prurel", - "pscr", - "psi", - "puncsp", - "qfr", - "qint", - "qopf", - "qprime", - "qscr", - "quaternions", - "quatint", - "quest", - "questeq", - "quot", - "rAarr", - "rArr", - "rAtail", - "rBarr", - "rHar", - "race", - "racute", - "radic", - "raemptyv", - "rang", - "rangd", - "range", - "rangle", - "raquo", - "rarr", - "rarrap", - "rarrb", - "rarrbfs", - "rarrc", - "rarrfs", - "rarrhk", - "rarrlp", - "rarrpl", - "rarrsim", - "rarrtl", - "rarrw", - "ratail", - "ratio", - "rationals", - "rbarr", - "rbbrk", - "rbrace", - "rbrack", - "rbrke", - "rbrksld", - "rbrkslu", - "rcaron", - "rcedil", - "rceil", - "rcub", - "rcy", - "rdca", - "rdldhar", - "rdquo", - "rdquor", - "rdsh", - "real", - "realine", - "realpart", - "reals", - "rect", - "reg", - "rfisht", - "rfloor", - "rfr", - "rhard", - "rharu", - "rharul", - "rho", - "rhov", - "rightarrow", - "rightarrowtail", - "rightharpoondown", - "rightharpoonup", - "rightleftarrows", - "rightleftharpoons", - "rightrightarrows", - "rightsquigarrow", - "rightthreetimes", - "ring", - "risingdotseq", - "rlarr", - "rlhar", - "rlm", - "rmoust", - "rmoustache", - "rnmid", - "roang", - "roarr", - "robrk", - "ropar", - "ropf", - "roplus", - "rotimes", - "rpar", - "rpargt", - "rppolint", - "rrarr", - "rsaquo", - "rscr", - "rsh", - "rsqb", - "rsquo", - "rsquor", - "rthree", - "rtimes", - "rtri", - "rtrie", - "rtrif", - "rtriltri", - "ruluhar", - "rx", - "sacute", - "sbquo", - "sc", - "scE", - "scap", - "scaron", - "sccue", - "sce", - "scedil", - "scirc", - "scnE", - "scnap", - "scnsim", - "scpolint", - "scsim", - "scy", - "sdot", - "sdotb", - "sdote", - "seArr", - "searhk", - "searr", - "searrow", - "sect", - "semi", - "seswar", - "setminus", - "setmn", - "sext", - "sfr", - "sfrown", - "sharp", - "shchcy", - "shcy", - "shortmid", - "shortparallel", - "shy", - "sigma", - "sigmaf", - "sigmav", - "sim", - "simdot", - "sime", - "simeq", - "simg", - "simgE", - "siml", - "simlE", - "simne", - "simplus", - "simrarr", - "slarr", - "smallsetminus", - "smashp", - "smeparsl", - "smid", - "smile", - "smt", - "smte", - "smtes", - "softcy", - "sol", - "solb", - "solbar", - "sopf", - "spades", - "spadesuit", - "spar", - "sqcap", - "sqcaps", - "sqcup", - "sqcups", - "sqsub", - "sqsube", - "sqsubset", - "sqsubseteq", - "sqsup", - "sqsupe", - "sqsupset", - "sqsupseteq", - "squ", - "square", - "squarf", - "squf", - "srarr", - "sscr", - "ssetmn", - "ssmile", - "sstarf", - "star", - "starf", - "straightepsilon", - "straightphi", - "strns", - "sub", - "subE", - "subdot", - "sube", - "subedot", - "submult", - "subnE", - "subne", - "subplus", - "subrarr", - "subset", - "subseteq", - "subseteqq", - "subsetneq", - "subsetneqq", - "subsim", - "subsub", - "subsup", - "succ", - "succapprox", - "succcurlyeq", - "succeq", - "succnapprox", - "succneqq", - "succnsim", - "succsim", - "sum", - "sung", - "sup", - "sup1", - "sup2", - "sup3", - "supE", - "supdot", - "supdsub", - "supe", - "supedot", - "suphsol", - "suphsub", - "suplarr", - "supmult", - "supnE", - "supne", - "supplus", - "supset", - "supseteq", - "supseteqq", - "supsetneq", - "supsetneqq", - "supsim", - "supsub", - "supsup", - "swArr", - "swarhk", - "swarr", - "swarrow", - "swnwar", - "szlig", - "target", - "tau", - "tbrk", - "tcaron", - "tcedil", - "tcy", - "tdot", - "telrec", - "tfr", - "there4", - "therefore", - "theta", - "thetasym", - "thetav", - "thickapprox", - "thicksim", - "thinsp", - "thkap", - "thksim", - "thorn", - "tilde", - "times", - "timesb", - "timesbar", - "timesd", - "tint", - "toea", - "top", - "topbot", - "topcir", - "topf", - "topfork", - "tosa", - "tprime", - "trade", - "triangle", - "triangledown", - "triangleleft", - "trianglelefteq", - "triangleq", - "triangleright", - "trianglerighteq", - "tridot", - "trie", - "triminus", - "triplus", - "trisb", - "tritime", - "trpezium", - "tscr", - "tscy", - "tshcy", - "tstrok", - "twixt", - "twoheadleftarrow", - "twoheadrightarrow", - "uArr", - "uHar", - "uacute", - "uarr", - "ubrcy", - "ubreve", - "ucirc", - "ucy", - "udarr", - "udblac", - "udhar", - "ufisht", - "ufr", - "ugrave", - "uharl", - "uharr", - "uhblk", - "ulcorn", - "ulcorner", - "ulcrop", - "ultri", - "umacr", - "uml", - "uogon", - "uopf", - "uparrow", - "updownarrow", - "upharpoonleft", - "upharpoonright", - "uplus", - "upsi", - "upsih", - "upsilon", - "upuparrows", - "urcorn", - "urcorner", - "urcrop", - "uring", - "urtri", - "uscr", - "utdot", - "utilde", - "utri", - "utrif", - "uuarr", - "uuml", - "uwangle", - "vArr", - "vBar", - "vBarv", - "vDash", - "vangrt", - "varepsilon", - "varkappa", - "varnothing", - "varphi", - "varpi", - "varpropto", - "varr", - "varrho", - "varsigma", - "varsubsetneq", - "varsubsetneqq", - "varsupsetneq", - "varsupsetneqq", - "vartheta", - "vartriangleleft", - "vartriangleright", - "vcy", - "vdash", - "vee", - "veebar", - "veeeq", - "vellip", - "verbar", - "vert", - "vfr", - "vltri", - "vnsub", - "vnsup", - "vopf", - "vprop", - "vrtri", - "vscr", - "vsubnE", - "vsubne", - "vsupnE", - "vsupne", - "vzigzag", - "wcirc", - "wedbar", - "wedge", - "wedgeq", - "weierp", - "wfr", - "wopf", - "wp", - "wr", - "wreath", - "wscr", - "xcap", - "xcirc", - "xcup", - "xdtri", - "xfr", - "xhArr", - "xharr", - "xi", - "xlArr", - "xlarr", - "xmap", - "xnis", - "xodot", - "xopf", - "xoplus", - "xotime", - "xrArr", - "xrarr", - "xscr", - "xsqcup", - "xuplus", - "xutri", - "xvee", - "xwedge", - "yacute", - "yacy", - "ycirc", - "ycy", - "yen", - "yfr", - "yicy", - "yopf", - "yscr", - "yucy", - "yuml", - "zacute", - "zcaron", - "zcy", - "zdot", - "zeetrf", - "zeta", - "zfr", - "zhcy", - "zigrarr", - "zopf", - "zscr", - "zwj", - "zwnj", - ]; +const ENTITIES: [(&[u8], &str); 2125] = [ + (b"AElig", "\u{00C6}"), + (b"AMP", "\u{0026}"), + (b"Aacute", "\u{00C1}"), + (b"Abreve", "\u{0102}"), + (b"Acirc", "\u{00C2}"), + (b"Acy", "\u{0410}"), + (b"Afr", "\u{1D504}"), + (b"Agrave", "\u{00C0}"), + (b"Alpha", "\u{0391}"), + (b"Amacr", "\u{0100}"), + (b"And", "\u{2A53}"), + (b"Aogon", "\u{0104}"), + (b"Aopf", "\u{1D538}"), + (b"ApplyFunction", "\u{2061}"), + (b"Aring", "\u{00C5}"), + (b"Ascr", "\u{1D49C}"), + (b"Assign", "\u{2254}"), + (b"Atilde", "\u{00C3}"), + (b"Auml", "\u{00C4}"), + (b"Backslash", "\u{2216}"), + (b"Barv", "\u{2AE7}"), + (b"Barwed", "\u{2306}"), + (b"Bcy", "\u{0411}"), + (b"Because", "\u{2235}"), + (b"Bernoullis", "\u{212C}"), + (b"Beta", "\u{0392}"), + (b"Bfr", "\u{1D505}"), + (b"Bopf", "\u{1D539}"), + (b"Breve", "\u{02D8}"), + (b"Bscr", "\u{212C}"), + (b"Bumpeq", "\u{224E}"), + (b"CHcy", "\u{0427}"), + (b"COPY", "\u{00A9}"), + (b"Cacute", "\u{0106}"), + (b"Cap", "\u{22D2}"), + (b"CapitalDifferentialD", "\u{2145}"), + (b"Cayleys", "\u{212D}"), + (b"Ccaron", "\u{010C}"), + (b"Ccedil", "\u{00C7}"), + (b"Ccirc", "\u{0108}"), + (b"Cconint", "\u{2230}"), + (b"Cdot", "\u{010A}"), + (b"Cedilla", "\u{00B8}"), + (b"CenterDot", "\u{00B7}"), + (b"Cfr", "\u{212D}"), + (b"Chi", "\u{03A7}"), + (b"CircleDot", "\u{2299}"), + (b"CircleMinus", "\u{2296}"), + (b"CirclePlus", "\u{2295}"), + (b"CircleTimes", "\u{2297}"), + (b"ClockwiseContourIntegral", "\u{2232}"), + (b"CloseCurlyDoubleQuote", "\u{201D}"), + (b"CloseCurlyQuote", "\u{2019}"), + (b"Colon", "\u{2237}"), + (b"Colone", "\u{2A74}"), + (b"Congruent", "\u{2261}"), + (b"Conint", "\u{222F}"), + (b"ContourIntegral", "\u{222E}"), + (b"Copf", "\u{2102}"), + (b"Coproduct", "\u{2210}"), + (b"CounterClockwiseContourIntegral", "\u{2233}"), + (b"Cross", "\u{2A2F}"), + (b"Cscr", "\u{1D49E}"), + (b"Cup", "\u{22D3}"), + (b"CupCap", "\u{224D}"), + (b"DD", "\u{2145}"), + (b"DDotrahd", "\u{2911}"), + (b"DJcy", "\u{0402}"), + (b"DScy", "\u{0405}"), + (b"DZcy", "\u{040F}"), + (b"Dagger", "\u{2021}"), + (b"Darr", "\u{21A1}"), + (b"Dashv", "\u{2AE4}"), + (b"Dcaron", "\u{010E}"), + (b"Dcy", "\u{0414}"), + (b"Del", "\u{2207}"), + (b"Delta", "\u{0394}"), + (b"Dfr", "\u{1D507}"), + (b"DiacriticalAcute", "\u{00B4}"), + (b"DiacriticalDot", "\u{02D9}"), + (b"DiacriticalDoubleAcute", "\u{02DD}"), + (b"DiacriticalGrave", "\u{0060}"), + (b"DiacriticalTilde", "\u{02DC}"), + (b"Diamond", "\u{22C4}"), + (b"DifferentialD", "\u{2146}"), + (b"Dopf", "\u{1D53B}"), + (b"Dot", "\u{00A8}"), + (b"DotDot", "\u{20DC}"), + (b"DotEqual", "\u{2250}"), + (b"DoubleContourIntegral", "\u{222F}"), + (b"DoubleDot", "\u{00A8}"), + (b"DoubleDownArrow", "\u{21D3}"), + (b"DoubleLeftArrow", "\u{21D0}"), + (b"DoubleLeftRightArrow", "\u{21D4}"), + (b"DoubleLeftTee", "\u{2AE4}"), + (b"DoubleLongLeftArrow", "\u{27F8}"), + (b"DoubleLongLeftRightArrow", "\u{27FA}"), + (b"DoubleLongRightArrow", "\u{27F9}"), + (b"DoubleRightArrow", "\u{21D2}"), + (b"DoubleRightTee", "\u{22A8}"), + (b"DoubleUpArrow", "\u{21D1}"), + (b"DoubleUpDownArrow", "\u{21D5}"), + (b"DoubleVerticalBar", "\u{2225}"), + (b"DownArrow", "\u{2193}"), + (b"DownArrowBar", "\u{2913}"), + (b"DownArrowUpArrow", "\u{21F5}"), + (b"DownBreve", "\u{0311}"), + (b"DownLeftRightVector", "\u{2950}"), + (b"DownLeftTeeVector", "\u{295E}"), + (b"DownLeftVector", "\u{21BD}"), + (b"DownLeftVectorBar", "\u{2956}"), + (b"DownRightTeeVector", "\u{295F}"), + (b"DownRightVector", "\u{21C1}"), + (b"DownRightVectorBar", "\u{2957}"), + (b"DownTee", "\u{22A4}"), + (b"DownTeeArrow", "\u{21A7}"), + (b"Downarrow", "\u{21D3}"), + (b"Dscr", "\u{1D49F}"), + (b"Dstrok", "\u{0110}"), + (b"ENG", "\u{014A}"), + (b"ETH", "\u{00D0}"), + (b"Eacute", "\u{00C9}"), + (b"Ecaron", "\u{011A}"), + (b"Ecirc", "\u{00CA}"), + (b"Ecy", "\u{042D}"), + (b"Edot", "\u{0116}"), + (b"Efr", "\u{1D508}"), + (b"Egrave", "\u{00C8}"), + (b"Element", "\u{2208}"), + (b"Emacr", "\u{0112}"), + (b"EmptySmallSquare", "\u{25FB}"), + (b"EmptyVerySmallSquare", "\u{25AB}"), + (b"Eogon", "\u{0118}"), + (b"Eopf", "\u{1D53C}"), + (b"Epsilon", "\u{0395}"), + (b"Equal", "\u{2A75}"), + (b"EqualTilde", "\u{2242}"), + (b"Equilibrium", "\u{21CC}"), + (b"Escr", "\u{2130}"), + (b"Esim", "\u{2A73}"), + (b"Eta", "\u{0397}"), + (b"Euml", "\u{00CB}"), + (b"Exists", "\u{2203}"), + (b"ExponentialE", "\u{2147}"), + (b"Fcy", "\u{0424}"), + (b"Ffr", "\u{1D509}"), + (b"FilledSmallSquare", "\u{25FC}"), + (b"FilledVerySmallSquare", "\u{25AA}"), + (b"Fopf", "\u{1D53D}"), + (b"ForAll", "\u{2200}"), + (b"Fouriertrf", "\u{2131}"), + (b"Fscr", "\u{2131}"), + (b"GJcy", "\u{0403}"), + (b"GT", "\u{003E}"), + (b"Gamma", "\u{0393}"), + (b"Gammad", "\u{03DC}"), + (b"Gbreve", "\u{011E}"), + (b"Gcedil", "\u{0122}"), + (b"Gcirc", "\u{011C}"), + (b"Gcy", "\u{0413}"), + (b"Gdot", "\u{0120}"), + (b"Gfr", "\u{1D50A}"), + (b"Gg", "\u{22D9}"), + (b"Gopf", "\u{1D53E}"), + (b"GreaterEqual", "\u{2265}"), + (b"GreaterEqualLess", "\u{22DB}"), + (b"GreaterFullEqual", "\u{2267}"), + (b"GreaterGreater", "\u{2AA2}"), + (b"GreaterLess", "\u{2277}"), + (b"GreaterSlantEqual", "\u{2A7E}"), + (b"GreaterTilde", "\u{2273}"), + (b"Gscr", "\u{1D4A2}"), + (b"Gt", "\u{226B}"), + (b"HARDcy", "\u{042A}"), + (b"Hacek", "\u{02C7}"), + (b"Hat", "\u{005E}"), + (b"Hcirc", "\u{0124}"), + (b"Hfr", "\u{210C}"), + (b"HilbertSpace", "\u{210B}"), + (b"Hopf", "\u{210D}"), + (b"HorizontalLine", "\u{2500}"), + (b"Hscr", "\u{210B}"), + (b"Hstrok", "\u{0126}"), + (b"HumpDownHump", "\u{224E}"), + (b"HumpEqual", "\u{224F}"), + (b"IEcy", "\u{0415}"), + (b"IJlig", "\u{0132}"), + (b"IOcy", "\u{0401}"), + (b"Iacute", "\u{00CD}"), + (b"Icirc", "\u{00CE}"), + (b"Icy", "\u{0418}"), + (b"Idot", "\u{0130}"), + (b"Ifr", "\u{2111}"), + (b"Igrave", "\u{00CC}"), + (b"Im", "\u{2111}"), + (b"Imacr", "\u{012A}"), + (b"ImaginaryI", "\u{2148}"), + (b"Implies", "\u{21D2}"), + (b"Int", "\u{222C}"), + (b"Integral", "\u{222B}"), + (b"Intersection", "\u{22C2}"), + (b"InvisibleComma", "\u{2063}"), + (b"InvisibleTimes", "\u{2062}"), + (b"Iogon", "\u{012E}"), + (b"Iopf", "\u{1D540}"), + (b"Iota", "\u{0399}"), + (b"Iscr", "\u{2110}"), + (b"Itilde", "\u{0128}"), + (b"Iukcy", "\u{0406}"), + (b"Iuml", "\u{00CF}"), + (b"Jcirc", "\u{0134}"), + (b"Jcy", "\u{0419}"), + (b"Jfr", "\u{1D50D}"), + (b"Jopf", "\u{1D541}"), + (b"Jscr", "\u{1D4A5}"), + (b"Jsercy", "\u{0408}"), + (b"Jukcy", "\u{0404}"), + (b"KHcy", "\u{0425}"), + (b"KJcy", "\u{040C}"), + (b"Kappa", "\u{039A}"), + (b"Kcedil", "\u{0136}"), + (b"Kcy", "\u{041A}"), + (b"Kfr", "\u{1D50E}"), + (b"Kopf", "\u{1D542}"), + (b"Kscr", "\u{1D4A6}"), + (b"LJcy", "\u{0409}"), + (b"LT", "\u{003C}"), + (b"Lacute", "\u{0139}"), + (b"Lambda", "\u{039B}"), + (b"Lang", "\u{27EA}"), + (b"Laplacetrf", "\u{2112}"), + (b"Larr", "\u{219E}"), + (b"Lcaron", "\u{013D}"), + (b"Lcedil", "\u{013B}"), + (b"Lcy", "\u{041B}"), + (b"LeftAngleBracket", "\u{27E8}"), + (b"LeftArrow", "\u{2190}"), + (b"LeftArrowBar", "\u{21E4}"), + (b"LeftArrowRightArrow", "\u{21C6}"), + (b"LeftCeiling", "\u{2308}"), + (b"LeftDoubleBracket", "\u{27E6}"), + (b"LeftDownTeeVector", "\u{2961}"), + (b"LeftDownVector", "\u{21C3}"), + (b"LeftDownVectorBar", "\u{2959}"), + (b"LeftFloor", "\u{230A}"), + (b"LeftRightArrow", "\u{2194}"), + (b"LeftRightVector", "\u{294E}"), + (b"LeftTee", "\u{22A3}"), + (b"LeftTeeArrow", "\u{21A4}"), + (b"LeftTeeVector", "\u{295A}"), + (b"LeftTriangle", "\u{22B2}"), + (b"LeftTriangleBar", "\u{29CF}"), + (b"LeftTriangleEqual", "\u{22B4}"), + (b"LeftUpDownVector", "\u{2951}"), + (b"LeftUpTeeVector", "\u{2960}"), + (b"LeftUpVector", "\u{21BF}"), + (b"LeftUpVectorBar", "\u{2958}"), + (b"LeftVector", "\u{21BC}"), + (b"LeftVectorBar", "\u{2952}"), + (b"Leftarrow", "\u{21D0}"), + (b"Leftrightarrow", "\u{21D4}"), + (b"LessEqualGreater", "\u{22DA}"), + (b"LessFullEqual", "\u{2266}"), + (b"LessGreater", "\u{2276}"), + (b"LessLess", "\u{2AA1}"), + (b"LessSlantEqual", "\u{2A7D}"), + (b"LessTilde", "\u{2272}"), + (b"Lfr", "\u{1D50F}"), + (b"Ll", "\u{22D8}"), + (b"Lleftarrow", "\u{21DA}"), + (b"Lmidot", "\u{013F}"), + (b"LongLeftArrow", "\u{27F5}"), + (b"LongLeftRightArrow", "\u{27F7}"), + (b"LongRightArrow", "\u{27F6}"), + (b"Longleftarrow", "\u{27F8}"), + (b"Longleftrightarrow", "\u{27FA}"), + (b"Longrightarrow", "\u{27F9}"), + (b"Lopf", "\u{1D543}"), + (b"LowerLeftArrow", "\u{2199}"), + (b"LowerRightArrow", "\u{2198}"), + (b"Lscr", "\u{2112}"), + (b"Lsh", "\u{21B0}"), + (b"Lstrok", "\u{0141}"), + (b"Lt", "\u{226A}"), + (b"Map", "\u{2905}"), + (b"Mcy", "\u{041C}"), + (b"MediumSpace", "\u{205F}"), + (b"Mellintrf", "\u{2133}"), + (b"Mfr", "\u{1D510}"), + (b"MinusPlus", "\u{2213}"), + (b"Mopf", "\u{1D544}"), + (b"Mscr", "\u{2133}"), + (b"Mu", "\u{039C}"), + (b"NJcy", "\u{040A}"), + (b"Nacute", "\u{0143}"), + (b"Ncaron", "\u{0147}"), + (b"Ncedil", "\u{0145}"), + (b"Ncy", "\u{041D}"), + (b"NegativeMediumSpace", "\u{200B}"), + (b"NegativeThickSpace", "\u{200B}"), + (b"NegativeThinSpace", "\u{200B}"), + (b"NegativeVeryThinSpace", "\u{200B}"), + (b"NestedGreaterGreater", "\u{226B}"), + (b"NestedLessLess", "\u{226A}"), + (b"NewLine", "\u{000A}"), + (b"Nfr", "\u{1D511}"), + (b"NoBreak", "\u{2060}"), + (b"NonBreakingSpace", "\u{00A0}"), + (b"Nopf", "\u{2115}"), + (b"Not", "\u{2AEC}"), + (b"NotCongruent", "\u{2262}"), + (b"NotCupCap", "\u{226D}"), + (b"NotDoubleVerticalBar", "\u{2226}"), + (b"NotElement", "\u{2209}"), + (b"NotEqual", "\u{2260}"), + (b"NotEqualTilde", "\u{2242}\u{0338}"), + (b"NotExists", "\u{2204}"), + (b"NotGreater", "\u{226F}"), + (b"NotGreaterEqual", "\u{2271}"), + (b"NotGreaterFullEqual", "\u{2267}\u{0338}"), + (b"NotGreaterGreater", "\u{226B}\u{0338}"), + (b"NotGreaterLess", "\u{2279}"), + (b"NotGreaterSlantEqual", "\u{2A7E}\u{0338}"), + (b"NotGreaterTilde", "\u{2275}"), + (b"NotHumpDownHump", "\u{224E}\u{0338}"), + (b"NotHumpEqual", "\u{224F}\u{0338}"), + (b"NotLeftTriangle", "\u{22EA}"), + (b"NotLeftTriangleBar", "\u{29CF}\u{0338}"), + (b"NotLeftTriangleEqual", "\u{22EC}"), + (b"NotLess", "\u{226E}"), + (b"NotLessEqual", "\u{2270}"), + (b"NotLessGreater", "\u{2278}"), + (b"NotLessLess", "\u{226A}\u{0338}"), + (b"NotLessSlantEqual", "\u{2A7D}\u{0338}"), + (b"NotLessTilde", "\u{2274}"), + (b"NotNestedGreaterGreater", "\u{2AA2}\u{0338}"), + (b"NotNestedLessLess", "\u{2AA1}\u{0338}"), + (b"NotPrecedes", "\u{2280}"), + (b"NotPrecedesEqual", "\u{2AAF}\u{0338}"), + (b"NotPrecedesSlantEqual", "\u{22E0}"), + (b"NotReverseElement", "\u{220C}"), + (b"NotRightTriangle", "\u{22EB}"), + (b"NotRightTriangleBar", "\u{29D0}\u{0338}"), + (b"NotRightTriangleEqual", "\u{22ED}"), + (b"NotSquareSubset", "\u{228F}\u{0338}"), + (b"NotSquareSubsetEqual", "\u{22E2}"), + (b"NotSquareSuperset", "\u{2290}\u{0338}"), + (b"NotSquareSupersetEqual", "\u{22E3}"), + (b"NotSubset", "\u{2282}\u{20D2}"), + (b"NotSubsetEqual", "\u{2288}"), + (b"NotSucceeds", "\u{2281}"), + (b"NotSucceedsEqual", "\u{2AB0}\u{0338}"), + (b"NotSucceedsSlantEqual", "\u{22E1}"), + (b"NotSucceedsTilde", "\u{227F}\u{0338}"), + (b"NotSuperset", "\u{2283}\u{20D2}"), + (b"NotSupersetEqual", "\u{2289}"), + (b"NotTilde", "\u{2241}"), + (b"NotTildeEqual", "\u{2244}"), + (b"NotTildeFullEqual", "\u{2247}"), + (b"NotTildeTilde", "\u{2249}"), + (b"NotVerticalBar", "\u{2224}"), + (b"Nscr", "\u{1D4A9}"), + (b"Ntilde", "\u{00D1}"), + (b"Nu", "\u{039D}"), + (b"OElig", "\u{0152}"), + (b"Oacute", "\u{00D3}"), + (b"Ocirc", "\u{00D4}"), + (b"Ocy", "\u{041E}"), + (b"Odblac", "\u{0150}"), + (b"Ofr", "\u{1D512}"), + (b"Ograve", "\u{00D2}"), + (b"Omacr", "\u{014C}"), + (b"Omega", "\u{03A9}"), + (b"Omicron", "\u{039F}"), + (b"Oopf", "\u{1D546}"), + (b"OpenCurlyDoubleQuote", "\u{201C}"), + (b"OpenCurlyQuote", "\u{2018}"), + (b"Or", "\u{2A54}"), + (b"Oscr", "\u{1D4AA}"), + (b"Oslash", "\u{00D8}"), + (b"Otilde", "\u{00D5}"), + (b"Otimes", "\u{2A37}"), + (b"Ouml", "\u{00D6}"), + (b"OverBar", "\u{203E}"), + (b"OverBrace", "\u{23DE}"), + (b"OverBracket", "\u{23B4}"), + (b"OverParenthesis", "\u{23DC}"), + (b"PartialD", "\u{2202}"), + (b"Pcy", "\u{041F}"), + (b"Pfr", "\u{1D513}"), + (b"Phi", "\u{03A6}"), + (b"Pi", "\u{03A0}"), + (b"PlusMinus", "\u{00B1}"), + (b"Poincareplane", "\u{210C}"), + (b"Popf", "\u{2119}"), + (b"Pr", "\u{2ABB}"), + (b"Precedes", "\u{227A}"), + (b"PrecedesEqual", "\u{2AAF}"), + (b"PrecedesSlantEqual", "\u{227C}"), + (b"PrecedesTilde", "\u{227E}"), + (b"Prime", "\u{2033}"), + (b"Product", "\u{220F}"), + (b"Proportion", "\u{2237}"), + (b"Proportional", "\u{221D}"), + (b"Pscr", "\u{1D4AB}"), + (b"Psi", "\u{03A8}"), + (b"QUOT", "\u{0022}"), + (b"Qfr", "\u{1D514}"), + (b"Qopf", "\u{211A}"), + (b"Qscr", "\u{1D4AC}"), + (b"RBarr", "\u{2910}"), + (b"REG", "\u{00AE}"), + (b"Racute", "\u{0154}"), + (b"Rang", "\u{27EB}"), + (b"Rarr", "\u{21A0}"), + (b"Rarrtl", "\u{2916}"), + (b"Rcaron", "\u{0158}"), + (b"Rcedil", "\u{0156}"), + (b"Rcy", "\u{0420}"), + (b"Re", "\u{211C}"), + (b"ReverseElement", "\u{220B}"), + (b"ReverseEquilibrium", "\u{21CB}"), + (b"ReverseUpEquilibrium", "\u{296F}"), + (b"Rfr", "\u{211C}"), + (b"Rho", "\u{03A1}"), + (b"RightAngleBracket", "\u{27E9}"), + (b"RightArrow", "\u{2192}"), + (b"RightArrowBar", "\u{21E5}"), + (b"RightArrowLeftArrow", "\u{21C4}"), + (b"RightCeiling", "\u{2309}"), + (b"RightDoubleBracket", "\u{27E7}"), + (b"RightDownTeeVector", "\u{295D}"), + (b"RightDownVector", "\u{21C2}"), + (b"RightDownVectorBar", "\u{2955}"), + (b"RightFloor", "\u{230B}"), + (b"RightTee", "\u{22A2}"), + (b"RightTeeArrow", "\u{21A6}"), + (b"RightTeeVector", "\u{295B}"), + (b"RightTriangle", "\u{22B3}"), + (b"RightTriangleBar", "\u{29D0}"), + (b"RightTriangleEqual", "\u{22B5}"), + (b"RightUpDownVector", "\u{294F}"), + (b"RightUpTeeVector", "\u{295C}"), + (b"RightUpVector", "\u{21BE}"), + (b"RightUpVectorBar", "\u{2954}"), + (b"RightVector", "\u{21C0}"), + (b"RightVectorBar", "\u{2953}"), + (b"Rightarrow", "\u{21D2}"), + (b"Ropf", "\u{211D}"), + (b"RoundImplies", "\u{2970}"), + (b"Rrightarrow", "\u{21DB}"), + (b"Rscr", "\u{211B}"), + (b"Rsh", "\u{21B1}"), + (b"RuleDelayed", "\u{29F4}"), + (b"SHCHcy", "\u{0429}"), + (b"SHcy", "\u{0428}"), + (b"SOFTcy", "\u{042C}"), + (b"Sacute", "\u{015A}"), + (b"Sc", "\u{2ABC}"), + (b"Scaron", "\u{0160}"), + (b"Scedil", "\u{015E}"), + (b"Scirc", "\u{015C}"), + (b"Scy", "\u{0421}"), + (b"Sfr", "\u{1D516}"), + (b"ShortDownArrow", "\u{2193}"), + (b"ShortLeftArrow", "\u{2190}"), + (b"ShortRightArrow", "\u{2192}"), + (b"ShortUpArrow", "\u{2191}"), + (b"Sigma", "\u{03A3}"), + (b"SmallCircle", "\u{2218}"), + (b"Sopf", "\u{1D54A}"), + (b"Sqrt", "\u{221A}"), + (b"Square", "\u{25A1}"), + (b"SquareIntersection", "\u{2293}"), + (b"SquareSubset", "\u{228F}"), + (b"SquareSubsetEqual", "\u{2291}"), + (b"SquareSuperset", "\u{2290}"), + (b"SquareSupersetEqual", "\u{2292}"), + (b"SquareUnion", "\u{2294}"), + (b"Sscr", "\u{1D4AE}"), + (b"Star", "\u{22C6}"), + (b"Sub", "\u{22D0}"), + (b"Subset", "\u{22D0}"), + (b"SubsetEqual", "\u{2286}"), + (b"Succeeds", "\u{227B}"), + (b"SucceedsEqual", "\u{2AB0}"), + (b"SucceedsSlantEqual", "\u{227D}"), + (b"SucceedsTilde", "\u{227F}"), + (b"SuchThat", "\u{220B}"), + (b"Sum", "\u{2211}"), + (b"Sup", "\u{22D1}"), + (b"Superset", "\u{2283}"), + (b"SupersetEqual", "\u{2287}"), + (b"Supset", "\u{22D1}"), + (b"THORN", "\u{00DE}"), + (b"TRADE", "\u{2122}"), + (b"TSHcy", "\u{040B}"), + (b"TScy", "\u{0426}"), + (b"Tab", "\u{0009}"), + (b"Tau", "\u{03A4}"), + (b"Tcaron", "\u{0164}"), + (b"Tcedil", "\u{0162}"), + (b"Tcy", "\u{0422}"), + (b"Tfr", "\u{1D517}"), + (b"Therefore", "\u{2234}"), + (b"Theta", "\u{0398}"), + (b"ThickSpace", "\u{205F}\u{200A}"), + (b"ThinSpace", "\u{2009}"), + (b"Tilde", "\u{223C}"), + (b"TildeEqual", "\u{2243}"), + (b"TildeFullEqual", "\u{2245}"), + (b"TildeTilde", "\u{2248}"), + (b"Topf", "\u{1D54B}"), + (b"TripleDot", "\u{20DB}"), + (b"Tscr", "\u{1D4AF}"), + (b"Tstrok", "\u{0166}"), + (b"Uacute", "\u{00DA}"), + (b"Uarr", "\u{219F}"), + (b"Uarrocir", "\u{2949}"), + (b"Ubrcy", "\u{040E}"), + (b"Ubreve", "\u{016C}"), + (b"Ucirc", "\u{00DB}"), + (b"Ucy", "\u{0423}"), + (b"Udblac", "\u{0170}"), + (b"Ufr", "\u{1D518}"), + (b"Ugrave", "\u{00D9}"), + (b"Umacr", "\u{016A}"), + (b"UnderBar", "\u{005F}"), + (b"UnderBrace", "\u{23DF}"), + (b"UnderBracket", "\u{23B5}"), + (b"UnderParenthesis", "\u{23DD}"), + (b"Union", "\u{22C3}"), + (b"UnionPlus", "\u{228E}"), + (b"Uogon", "\u{0172}"), + (b"Uopf", "\u{1D54C}"), + (b"UpArrow", "\u{2191}"), + (b"UpArrowBar", "\u{2912}"), + (b"UpArrowDownArrow", "\u{21C5}"), + (b"UpDownArrow", "\u{2195}"), + (b"UpEquilibrium", "\u{296E}"), + (b"UpTee", "\u{22A5}"), + (b"UpTeeArrow", "\u{21A5}"), + (b"Uparrow", "\u{21D1}"), + (b"Updownarrow", "\u{21D5}"), + (b"UpperLeftArrow", "\u{2196}"), + (b"UpperRightArrow", "\u{2197}"), + (b"Upsi", "\u{03D2}"), + (b"Upsilon", "\u{03A5}"), + (b"Uring", "\u{016E}"), + (b"Uscr", "\u{1D4B0}"), + (b"Utilde", "\u{0168}"), + (b"Uuml", "\u{00DC}"), + (b"VDash", "\u{22AB}"), + (b"Vbar", "\u{2AEB}"), + (b"Vcy", "\u{0412}"), + (b"Vdash", "\u{22A9}"), + (b"Vdashl", "\u{2AE6}"), + (b"Vee", "\u{22C1}"), + (b"Verbar", "\u{2016}"), + (b"Vert", "\u{2016}"), + (b"VerticalBar", "\u{2223}"), + (b"VerticalLine", "\u{007C}"), + (b"VerticalSeparator", "\u{2758}"), + (b"VerticalTilde", "\u{2240}"), + (b"VeryThinSpace", "\u{200A}"), + (b"Vfr", "\u{1D519}"), + (b"Vopf", "\u{1D54D}"), + (b"Vscr", "\u{1D4B1}"), + (b"Vvdash", "\u{22AA}"), + (b"Wcirc", "\u{0174}"), + (b"Wedge", "\u{22C0}"), + (b"Wfr", "\u{1D51A}"), + (b"Wopf", "\u{1D54E}"), + (b"Wscr", "\u{1D4B2}"), + (b"Xfr", "\u{1D51B}"), + (b"Xi", "\u{039E}"), + (b"Xopf", "\u{1D54F}"), + (b"Xscr", "\u{1D4B3}"), + (b"YAcy", "\u{042F}"), + (b"YIcy", "\u{0407}"), + (b"YUcy", "\u{042E}"), + (b"Yacute", "\u{00DD}"), + (b"Ycirc", "\u{0176}"), + (b"Ycy", "\u{042B}"), + (b"Yfr", "\u{1D51C}"), + (b"Yopf", "\u{1D550}"), + (b"Yscr", "\u{1D4B4}"), + (b"Yuml", "\u{0178}"), + (b"ZHcy", "\u{0416}"), + (b"Zacute", "\u{0179}"), + (b"Zcaron", "\u{017D}"), + (b"Zcy", "\u{0417}"), + (b"Zdot", "\u{017B}"), + (b"ZeroWidthSpace", "\u{200B}"), + (b"Zeta", "\u{0396}"), + (b"Zfr", "\u{2128}"), + (b"Zopf", "\u{2124}"), + (b"Zscr", "\u{1D4B5}"), + (b"aacute", "\u{00E1}"), + (b"abreve", "\u{0103}"), + (b"ac", "\u{223E}"), + (b"acE", "\u{223E}\u{0333}"), + (b"acd", "\u{223F}"), + (b"acirc", "\u{00E2}"), + (b"acute", "\u{00B4}"), + (b"acy", "\u{0430}"), + (b"aelig", "\u{00E6}"), + (b"af", "\u{2061}"), + (b"afr", "\u{1D51E}"), + (b"agrave", "\u{00E0}"), + (b"alefsym", "\u{2135}"), + (b"aleph", "\u{2135}"), + (b"alpha", "\u{03B1}"), + (b"amacr", "\u{0101}"), + (b"amalg", "\u{2A3F}"), + (b"amp", "\u{0026}"), + (b"and", "\u{2227}"), + (b"andand", "\u{2A55}"), + (b"andd", "\u{2A5C}"), + (b"andslope", "\u{2A58}"), + (b"andv", "\u{2A5A}"), + (b"ang", "\u{2220}"), + (b"ange", "\u{29A4}"), + (b"angle", "\u{2220}"), + (b"angmsd", "\u{2221}"), + (b"angmsdaa", "\u{29A8}"), + (b"angmsdab", "\u{29A9}"), + (b"angmsdac", "\u{29AA}"), + (b"angmsdad", "\u{29AB}"), + (b"angmsdae", "\u{29AC}"), + (b"angmsdaf", "\u{29AD}"), + (b"angmsdag", "\u{29AE}"), + (b"angmsdah", "\u{29AF}"), + (b"angrt", "\u{221F}"), + (b"angrtvb", "\u{22BE}"), + (b"angrtvbd", "\u{299D}"), + (b"angsph", "\u{2222}"), + (b"angst", "\u{00C5}"), + (b"angzarr", "\u{237C}"), + (b"aogon", "\u{0105}"), + (b"aopf", "\u{1D552}"), + (b"ap", "\u{2248}"), + (b"apE", "\u{2A70}"), + (b"apacir", "\u{2A6F}"), + (b"ape", "\u{224A}"), + (b"apid", "\u{224B}"), + (b"apos", "\u{0027}"), + (b"approx", "\u{2248}"), + (b"approxeq", "\u{224A}"), + (b"aring", "\u{00E5}"), + (b"ascr", "\u{1D4B6}"), + (b"ast", "\u{002A}"), + (b"asymp", "\u{2248}"), + (b"asympeq", "\u{224D}"), + (b"atilde", "\u{00E3}"), + (b"auml", "\u{00E4}"), + (b"awconint", "\u{2233}"), + (b"awint", "\u{2A11}"), + (b"bNot", "\u{2AED}"), + (b"backcong", "\u{224C}"), + (b"backepsilon", "\u{03F6}"), + (b"backprime", "\u{2035}"), + (b"backsim", "\u{223D}"), + (b"backsimeq", "\u{22CD}"), + (b"barvee", "\u{22BD}"), + (b"barwed", "\u{2305}"), + (b"barwedge", "\u{2305}"), + (b"bbrk", "\u{23B5}"), + (b"bbrktbrk", "\u{23B6}"), + (b"bcong", "\u{224C}"), + (b"bcy", "\u{0431}"), + (b"bdquo", "\u{201E}"), + (b"becaus", "\u{2235}"), + (b"because", "\u{2235}"), + (b"bemptyv", "\u{29B0}"), + (b"bepsi", "\u{03F6}"), + (b"bernou", "\u{212C}"), + (b"beta", "\u{03B2}"), + (b"beth", "\u{2136}"), + (b"between", "\u{226C}"), + (b"bfr", "\u{1D51F}"), + (b"bigcap", "\u{22C2}"), + (b"bigcirc", "\u{25EF}"), + (b"bigcup", "\u{22C3}"), + (b"bigodot", "\u{2A00}"), + (b"bigoplus", "\u{2A01}"), + (b"bigotimes", "\u{2A02}"), + (b"bigsqcup", "\u{2A06}"), + (b"bigstar", "\u{2605}"), + (b"bigtriangledown", "\u{25BD}"), + (b"bigtriangleup", "\u{25B3}"), + (b"biguplus", "\u{2A04}"), + (b"bigvee", "\u{22C1}"), + (b"bigwedge", "\u{22C0}"), + (b"bkarow", "\u{290D}"), + (b"blacklozenge", "\u{29EB}"), + (b"blacksquare", "\u{25AA}"), + (b"blacktriangle", "\u{25B4}"), + (b"blacktriangledown", "\u{25BE}"), + (b"blacktriangleleft", "\u{25C2}"), + (b"blacktriangleright", "\u{25B8}"), + (b"blank", "\u{2423}"), + (b"blk12", "\u{2592}"), + (b"blk14", "\u{2591}"), + (b"blk34", "\u{2593}"), + (b"block", "\u{2588}"), + (b"bne", "\u{003D}\u{20E5}"), + (b"bnequiv", "\u{2261}\u{20E5}"), + (b"bnot", "\u{2310}"), + (b"bopf", "\u{1D553}"), + (b"bot", "\u{22A5}"), + (b"bottom", "\u{22A5}"), + (b"bowtie", "\u{22C8}"), + (b"boxDL", "\u{2557}"), + (b"boxDR", "\u{2554}"), + (b"boxDl", "\u{2556}"), + (b"boxDr", "\u{2553}"), + (b"boxH", "\u{2550}"), + (b"boxHD", "\u{2566}"), + (b"boxHU", "\u{2569}"), + (b"boxHd", "\u{2564}"), + (b"boxHu", "\u{2567}"), + (b"boxUL", "\u{255D}"), + (b"boxUR", "\u{255A}"), + (b"boxUl", "\u{255C}"), + (b"boxUr", "\u{2559}"), + (b"boxV", "\u{2551}"), + (b"boxVH", "\u{256C}"), + (b"boxVL", "\u{2563}"), + (b"boxVR", "\u{2560}"), + (b"boxVh", "\u{256B}"), + (b"boxVl", "\u{2562}"), + (b"boxVr", "\u{255F}"), + (b"boxbox", "\u{29C9}"), + (b"boxdL", "\u{2555}"), + (b"boxdR", "\u{2552}"), + (b"boxdl", "\u{2510}"), + (b"boxdr", "\u{250C}"), + (b"boxh", "\u{2500}"), + (b"boxhD", "\u{2565}"), + (b"boxhU", "\u{2568}"), + (b"boxhd", "\u{252C}"), + (b"boxhu", "\u{2534}"), + (b"boxminus", "\u{229F}"), + (b"boxplus", "\u{229E}"), + (b"boxtimes", "\u{22A0}"), + (b"boxuL", "\u{255B}"), + (b"boxuR", "\u{2558}"), + (b"boxul", "\u{2518}"), + (b"boxur", "\u{2514}"), + (b"boxv", "\u{2502}"), + (b"boxvH", "\u{256A}"), + (b"boxvL", "\u{2561}"), + (b"boxvR", "\u{255E}"), + (b"boxvh", "\u{253C}"), + (b"boxvl", "\u{2524}"), + (b"boxvr", "\u{251C}"), + (b"bprime", "\u{2035}"), + (b"breve", "\u{02D8}"), + (b"brvbar", "\u{00A6}"), + (b"bscr", "\u{1D4B7}"), + (b"bsemi", "\u{204F}"), + (b"bsim", "\u{223D}"), + (b"bsime", "\u{22CD}"), + (b"bsol", "\u{005C}"), + (b"bsolb", "\u{29C5}"), + (b"bsolhsub", "\u{27C8}"), + (b"bull", "\u{2022}"), + (b"bullet", "\u{2022}"), + (b"bump", "\u{224E}"), + (b"bumpE", "\u{2AAE}"), + (b"bumpe", "\u{224F}"), + (b"bumpeq", "\u{224F}"), + (b"cacute", "\u{0107}"), + (b"cap", "\u{2229}"), + (b"capand", "\u{2A44}"), + (b"capbrcup", "\u{2A49}"), + (b"capcap", "\u{2A4B}"), + (b"capcup", "\u{2A47}"), + (b"capdot", "\u{2A40}"), + (b"caps", "\u{2229}\u{FE00}"), + (b"caret", "\u{2041}"), + (b"caron", "\u{02C7}"), + (b"ccaps", "\u{2A4D}"), + (b"ccaron", "\u{010D}"), + (b"ccedil", "\u{00E7}"), + (b"ccirc", "\u{0109}"), + (b"ccups", "\u{2A4C}"), + (b"ccupssm", "\u{2A50}"), + (b"cdot", "\u{010B}"), + (b"cedil", "\u{00B8}"), + (b"cemptyv", "\u{29B2}"), + (b"cent", "\u{00A2}"), + (b"centerdot", "\u{00B7}"), + (b"cfr", "\u{1D520}"), + (b"chcy", "\u{0447}"), + (b"check", "\u{2713}"), + (b"checkmark", "\u{2713}"), + (b"chi", "\u{03C7}"), + (b"cir", "\u{25CB}"), + (b"cirE", "\u{29C3}"), + (b"circ", "\u{02C6}"), + (b"circeq", "\u{2257}"), + (b"circlearrowleft", "\u{21BA}"), + (b"circlearrowright", "\u{21BB}"), + (b"circledR", "\u{00AE}"), + (b"circledS", "\u{24C8}"), + (b"circledast", "\u{229B}"), + (b"circledcirc", "\u{229A}"), + (b"circleddash", "\u{229D}"), + (b"cire", "\u{2257}"), + (b"cirfnint", "\u{2A10}"), + (b"cirmid", "\u{2AEF}"), + (b"cirscir", "\u{29C2}"), + (b"clubs", "\u{2663}"), + (b"clubsuit", "\u{2663}"), + (b"colon", "\u{003A}"), + (b"colone", "\u{2254}"), + (b"coloneq", "\u{2254}"), + (b"comma", "\u{002C}"), + (b"commat", "\u{0040}"), + (b"comp", "\u{2201}"), + (b"compfn", "\u{2218}"), + (b"complement", "\u{2201}"), + (b"complexes", "\u{2102}"), + (b"cong", "\u{2245}"), + (b"congdot", "\u{2A6D}"), + (b"conint", "\u{222E}"), + (b"copf", "\u{1D554}"), + (b"coprod", "\u{2210}"), + (b"copy", "\u{00A9}"), + (b"copysr", "\u{2117}"), + (b"crarr", "\u{21B5}"), + (b"cross", "\u{2717}"), + (b"cscr", "\u{1D4B8}"), + (b"csub", "\u{2ACF}"), + (b"csube", "\u{2AD1}"), + (b"csup", "\u{2AD0}"), + (b"csupe", "\u{2AD2}"), + (b"ctdot", "\u{22EF}"), + (b"cudarrl", "\u{2938}"), + (b"cudarrr", "\u{2935}"), + (b"cuepr", "\u{22DE}"), + (b"cuesc", "\u{22DF}"), + (b"cularr", "\u{21B6}"), + (b"cularrp", "\u{293D}"), + (b"cup", "\u{222A}"), + (b"cupbrcap", "\u{2A48}"), + (b"cupcap", "\u{2A46}"), + (b"cupcup", "\u{2A4A}"), + (b"cupdot", "\u{228D}"), + (b"cupor", "\u{2A45}"), + (b"cups", "\u{222A}\u{FE00}"), + (b"curarr", "\u{21B7}"), + (b"curarrm", "\u{293C}"), + (b"curlyeqprec", "\u{22DE}"), + (b"curlyeqsucc", "\u{22DF}"), + (b"curlyvee", "\u{22CE}"), + (b"curlywedge", "\u{22CF}"), + (b"curren", "\u{00A4}"), + (b"curvearrowleft", "\u{21B6}"), + (b"curvearrowright", "\u{21B7}"), + (b"cuvee", "\u{22CE}"), + (b"cuwed", "\u{22CF}"), + (b"cwconint", "\u{2232}"), + (b"cwint", "\u{2231}"), + (b"cylcty", "\u{232D}"), + (b"dArr", "\u{21D3}"), + (b"dHar", "\u{2965}"), + (b"dagger", "\u{2020}"), + (b"daleth", "\u{2138}"), + (b"darr", "\u{2193}"), + (b"dash", "\u{2010}"), + (b"dashv", "\u{22A3}"), + (b"dbkarow", "\u{290F}"), + (b"dblac", "\u{02DD}"), + (b"dcaron", "\u{010F}"), + (b"dcy", "\u{0434}"), + (b"dd", "\u{2146}"), + (b"ddagger", "\u{2021}"), + (b"ddarr", "\u{21CA}"), + (b"ddotseq", "\u{2A77}"), + (b"deg", "\u{00B0}"), + (b"delta", "\u{03B4}"), + (b"demptyv", "\u{29B1}"), + (b"dfisht", "\u{297F}"), + (b"dfr", "\u{1D521}"), + (b"dharl", "\u{21C3}"), + (b"dharr", "\u{21C2}"), + (b"diam", "\u{22C4}"), + (b"diamond", "\u{22C4}"), + (b"diamondsuit", "\u{2666}"), + (b"diams", "\u{2666}"), + (b"die", "\u{00A8}"), + (b"digamma", "\u{03DD}"), + (b"disin", "\u{22F2}"), + (b"div", "\u{00F7}"), + (b"divide", "\u{00F7}"), + (b"divideontimes", "\u{22C7}"), + (b"divonx", "\u{22C7}"), + (b"djcy", "\u{0452}"), + (b"dlcorn", "\u{231E}"), + (b"dlcrop", "\u{230D}"), + (b"dollar", "\u{0024}"), + (b"dopf", "\u{1D555}"), + (b"dot", "\u{02D9}"), + (b"doteq", "\u{2250}"), + (b"doteqdot", "\u{2251}"), + (b"dotminus", "\u{2238}"), + (b"dotplus", "\u{2214}"), + (b"dotsquare", "\u{22A1}"), + (b"doublebarwedge", "\u{2306}"), + (b"downarrow", "\u{2193}"), + (b"downdownarrows", "\u{21CA}"), + (b"downharpoonleft", "\u{21C3}"), + (b"downharpoonright", "\u{21C2}"), + (b"drbkarow", "\u{2910}"), + (b"drcorn", "\u{231F}"), + (b"drcrop", "\u{230C}"), + (b"dscr", "\u{1D4B9}"), + (b"dscy", "\u{0455}"), + (b"dsol", "\u{29F6}"), + (b"dstrok", "\u{0111}"), + (b"dtdot", "\u{22F1}"), + (b"dtri", "\u{25BF}"), + (b"dtrif", "\u{25BE}"), + (b"duarr", "\u{21F5}"), + (b"duhar", "\u{296F}"), + (b"dwangle", "\u{29A6}"), + (b"dzcy", "\u{045F}"), + (b"dzigrarr", "\u{27FF}"), + (b"eDDot", "\u{2A77}"), + (b"eDot", "\u{2251}"), + (b"eacute", "\u{00E9}"), + (b"easter", "\u{2A6E}"), + (b"ecaron", "\u{011B}"), + (b"ecir", "\u{2256}"), + (b"ecirc", "\u{00EA}"), + (b"ecolon", "\u{2255}"), + (b"ecy", "\u{044D}"), + (b"edot", "\u{0117}"), + (b"ee", "\u{2147}"), + (b"efDot", "\u{2252}"), + (b"efr", "\u{1D522}"), + (b"eg", "\u{2A9A}"), + (b"egrave", "\u{00E8}"), + (b"egs", "\u{2A96}"), + (b"egsdot", "\u{2A98}"), + (b"el", "\u{2A99}"), + (b"elinters", "\u{23E7}"), + (b"ell", "\u{2113}"), + (b"els", "\u{2A95}"), + (b"elsdot", "\u{2A97}"), + (b"emacr", "\u{0113}"), + (b"empty", "\u{2205}"), + (b"emptyset", "\u{2205}"), + (b"emptyv", "\u{2205}"), + (b"emsp", "\u{2003}"), + (b"emsp13", "\u{2004}"), + (b"emsp14", "\u{2005}"), + (b"eng", "\u{014B}"), + (b"ensp", "\u{2002}"), + (b"eogon", "\u{0119}"), + (b"eopf", "\u{1D556}"), + (b"epar", "\u{22D5}"), + (b"eparsl", "\u{29E3}"), + (b"eplus", "\u{2A71}"), + (b"epsi", "\u{03B5}"), + (b"epsilon", "\u{03B5}"), + (b"epsiv", "\u{03F5}"), + (b"eqcirc", "\u{2256}"), + (b"eqcolon", "\u{2255}"), + (b"eqsim", "\u{2242}"), + (b"eqslantgtr", "\u{2A96}"), + (b"eqslantless", "\u{2A95}"), + (b"equals", "\u{003D}"), + (b"equest", "\u{225F}"), + (b"equiv", "\u{2261}"), + (b"equivDD", "\u{2A78}"), + (b"eqvparsl", "\u{29E5}"), + (b"erDot", "\u{2253}"), + (b"erarr", "\u{2971}"), + (b"escr", "\u{212F}"), + (b"esdot", "\u{2250}"), + (b"esim", "\u{2242}"), + (b"eta", "\u{03B7}"), + (b"eth", "\u{00F0}"), + (b"euml", "\u{00EB}"), + (b"euro", "\u{20AC}"), + (b"excl", "\u{0021}"), + (b"exist", "\u{2203}"), + (b"expectation", "\u{2130}"), + (b"exponentiale", "\u{2147}"), + (b"fallingdotseq", "\u{2252}"), + (b"fcy", "\u{0444}"), + (b"female", "\u{2640}"), + (b"ffilig", "\u{FB03}"), + (b"fflig", "\u{FB00}"), + (b"ffllig", "\u{FB04}"), + (b"ffr", "\u{1D523}"), + (b"filig", "\u{FB01}"), + (b"fjlig", "\u{0066}\u{006A}"), + (b"flat", "\u{266D}"), + (b"fllig", "\u{FB02}"), + (b"fltns", "\u{25B1}"), + (b"fnof", "\u{0192}"), + (b"fopf", "\u{1D557}"), + (b"forall", "\u{2200}"), + (b"fork", "\u{22D4}"), + (b"forkv", "\u{2AD9}"), + (b"fpartint", "\u{2A0D}"), + (b"frac12", "\u{00BD}"), + (b"frac13", "\u{2153}"), + (b"frac14", "\u{00BC}"), + (b"frac15", "\u{2155}"), + (b"frac16", "\u{2159}"), + (b"frac18", "\u{215B}"), + (b"frac23", "\u{2154}"), + (b"frac25", "\u{2156}"), + (b"frac34", "\u{00BE}"), + (b"frac35", "\u{2157}"), + (b"frac38", "\u{215C}"), + (b"frac45", "\u{2158}"), + (b"frac56", "\u{215A}"), + (b"frac58", "\u{215D}"), + (b"frac78", "\u{215E}"), + (b"frasl", "\u{2044}"), + (b"frown", "\u{2322}"), + (b"fscr", "\u{1D4BB}"), + (b"gE", "\u{2267}"), + (b"gEl", "\u{2A8C}"), + (b"gacute", "\u{01F5}"), + (b"gamma", "\u{03B3}"), + (b"gammad", "\u{03DD}"), + (b"gap", "\u{2A86}"), + (b"gbreve", "\u{011F}"), + (b"gcirc", "\u{011D}"), + (b"gcy", "\u{0433}"), + (b"gdot", "\u{0121}"), + (b"ge", "\u{2265}"), + (b"gel", "\u{22DB}"), + (b"geq", "\u{2265}"), + (b"geqq", "\u{2267}"), + (b"geqslant", "\u{2A7E}"), + (b"ges", "\u{2A7E}"), + (b"gescc", "\u{2AA9}"), + (b"gesdot", "\u{2A80}"), + (b"gesdoto", "\u{2A82}"), + (b"gesdotol", "\u{2A84}"), + (b"gesl", "\u{22DB}\u{FE00}"), + (b"gesles", "\u{2A94}"), + (b"gfr", "\u{1D524}"), + (b"gg", "\u{226B}"), + (b"ggg", "\u{22D9}"), + (b"gimel", "\u{2137}"), + (b"gjcy", "\u{0453}"), + (b"gl", "\u{2277}"), + (b"glE", "\u{2A92}"), + (b"gla", "\u{2AA5}"), + (b"glj", "\u{2AA4}"), + (b"gnE", "\u{2269}"), + (b"gnap", "\u{2A8A}"), + (b"gnapprox", "\u{2A8A}"), + (b"gne", "\u{2A88}"), + (b"gneq", "\u{2A88}"), + (b"gneqq", "\u{2269}"), + (b"gnsim", "\u{22E7}"), + (b"gopf", "\u{1D558}"), + (b"grave", "\u{0060}"), + (b"gscr", "\u{210A}"), + (b"gsim", "\u{2273}"), + (b"gsime", "\u{2A8E}"), + (b"gsiml", "\u{2A90}"), + (b"gt", "\u{003E}"), + (b"gtcc", "\u{2AA7}"), + (b"gtcir", "\u{2A7A}"), + (b"gtdot", "\u{22D7}"), + (b"gtlPar", "\u{2995}"), + (b"gtquest", "\u{2A7C}"), + (b"gtrapprox", "\u{2A86}"), + (b"gtrarr", "\u{2978}"), + (b"gtrdot", "\u{22D7}"), + (b"gtreqless", "\u{22DB}"), + (b"gtreqqless", "\u{2A8C}"), + (b"gtrless", "\u{2277}"), + (b"gtrsim", "\u{2273}"), + (b"gvertneqq", "\u{2269}\u{FE00}"), + (b"gvnE", "\u{2269}\u{FE00}"), + (b"hArr", "\u{21D4}"), + (b"hairsp", "\u{200A}"), + (b"half", "\u{00BD}"), + (b"hamilt", "\u{210B}"), + (b"hardcy", "\u{044A}"), + (b"harr", "\u{2194}"), + (b"harrcir", "\u{2948}"), + (b"harrw", "\u{21AD}"), + (b"hbar", "\u{210F}"), + (b"hcirc", "\u{0125}"), + (b"hearts", "\u{2665}"), + (b"heartsuit", "\u{2665}"), + (b"hellip", "\u{2026}"), + (b"hercon", "\u{22B9}"), + (b"hfr", "\u{1D525}"), + (b"hksearow", "\u{2925}"), + (b"hkswarow", "\u{2926}"), + (b"hoarr", "\u{21FF}"), + (b"homtht", "\u{223B}"), + (b"hookleftarrow", "\u{21A9}"), + (b"hookrightarrow", "\u{21AA}"), + (b"hopf", "\u{1D559}"), + (b"horbar", "\u{2015}"), + (b"hscr", "\u{1D4BD}"), + (b"hslash", "\u{210F}"), + (b"hstrok", "\u{0127}"), + (b"hybull", "\u{2043}"), + (b"hyphen", "\u{2010}"), + (b"iacute", "\u{00ED}"), + (b"ic", "\u{2063}"), + (b"icirc", "\u{00EE}"), + (b"icy", "\u{0438}"), + (b"iecy", "\u{0435}"), + (b"iexcl", "\u{00A1}"), + (b"iff", "\u{21D4}"), + (b"ifr", "\u{1D526}"), + (b"igrave", "\u{00EC}"), + (b"ii", "\u{2148}"), + (b"iiiint", "\u{2A0C}"), + (b"iiint", "\u{222D}"), + (b"iinfin", "\u{29DC}"), + (b"iiota", "\u{2129}"), + (b"ijlig", "\u{0133}"), + (b"imacr", "\u{012B}"), + (b"image", "\u{2111}"), + (b"imagline", "\u{2110}"), + (b"imagpart", "\u{2111}"), + (b"imath", "\u{0131}"), + (b"imof", "\u{22B7}"), + (b"imped", "\u{01B5}"), + (b"in", "\u{2208}"), + (b"incare", "\u{2105}"), + (b"infin", "\u{221E}"), + (b"infintie", "\u{29DD}"), + (b"inodot", "\u{0131}"), + (b"int", "\u{222B}"), + (b"intcal", "\u{22BA}"), + (b"integers", "\u{2124}"), + (b"intercal", "\u{22BA}"), + (b"intlarhk", "\u{2A17}"), + (b"intprod", "\u{2A3C}"), + (b"iocy", "\u{0451}"), + (b"iogon", "\u{012F}"), + (b"iopf", "\u{1D55A}"), + (b"iota", "\u{03B9}"), + (b"iprod", "\u{2A3C}"), + (b"iquest", "\u{00BF}"), + (b"iscr", "\u{1D4BE}"), + (b"isin", "\u{2208}"), + (b"isinE", "\u{22F9}"), + (b"isindot", "\u{22F5}"), + (b"isins", "\u{22F4}"), + (b"isinsv", "\u{22F3}"), + (b"isinv", "\u{2208}"), + (b"it", "\u{2062}"), + (b"itilde", "\u{0129}"), + (b"iukcy", "\u{0456}"), + (b"iuml", "\u{00EF}"), + (b"jcirc", "\u{0135}"), + (b"jcy", "\u{0439}"), + (b"jfr", "\u{1D527}"), + (b"jmath", "\u{0237}"), + (b"jopf", "\u{1D55B}"), + (b"jscr", "\u{1D4BF}"), + (b"jsercy", "\u{0458}"), + (b"jukcy", "\u{0454}"), + (b"kappa", "\u{03BA}"), + (b"kappav", "\u{03F0}"), + (b"kcedil", "\u{0137}"), + (b"kcy", "\u{043A}"), + (b"kfr", "\u{1D528}"), + (b"kgreen", "\u{0138}"), + (b"khcy", "\u{0445}"), + (b"kjcy", "\u{045C}"), + (b"kopf", "\u{1D55C}"), + (b"kscr", "\u{1D4C0}"), + (b"lAarr", "\u{21DA}"), + (b"lArr", "\u{21D0}"), + (b"lAtail", "\u{291B}"), + (b"lBarr", "\u{290E}"), + (b"lE", "\u{2266}"), + (b"lEg", "\u{2A8B}"), + (b"lHar", "\u{2962}"), + (b"lacute", "\u{013A}"), + (b"laemptyv", "\u{29B4}"), + (b"lagran", "\u{2112}"), + (b"lambda", "\u{03BB}"), + (b"lang", "\u{27E8}"), + (b"langd", "\u{2991}"), + (b"langle", "\u{27E8}"), + (b"lap", "\u{2A85}"), + (b"laquo", "\u{00AB}"), + (b"larr", "\u{2190}"), + (b"larrb", "\u{21E4}"), + (b"larrbfs", "\u{291F}"), + (b"larrfs", "\u{291D}"), + (b"larrhk", "\u{21A9}"), + (b"larrlp", "\u{21AB}"), + (b"larrpl", "\u{2939}"), + (b"larrsim", "\u{2973}"), + (b"larrtl", "\u{21A2}"), + (b"lat", "\u{2AAB}"), + (b"latail", "\u{2919}"), + (b"late", "\u{2AAD}"), + (b"lates", "\u{2AAD}\u{FE00}"), + (b"lbarr", "\u{290C}"), + (b"lbbrk", "\u{2772}"), + (b"lbrace", "\u{007B}"), + (b"lbrack", "\u{005B}"), + (b"lbrke", "\u{298B}"), + (b"lbrksld", "\u{298F}"), + (b"lbrkslu", "\u{298D}"), + (b"lcaron", "\u{013E}"), + (b"lcedil", "\u{013C}"), + (b"lceil", "\u{2308}"), + (b"lcub", "\u{007B}"), + (b"lcy", "\u{043B}"), + (b"ldca", "\u{2936}"), + (b"ldquo", "\u{201C}"), + (b"ldquor", "\u{201E}"), + (b"ldrdhar", "\u{2967}"), + (b"ldrushar", "\u{294B}"), + (b"ldsh", "\u{21B2}"), + (b"le", "\u{2264}"), + (b"leftarrow", "\u{2190}"), + (b"leftarrowtail", "\u{21A2}"), + (b"leftharpoondown", "\u{21BD}"), + (b"leftharpoonup", "\u{21BC}"), + (b"leftleftarrows", "\u{21C7}"), + (b"leftrightarrow", "\u{2194}"), + (b"leftrightarrows", "\u{21C6}"), + (b"leftrightharpoons", "\u{21CB}"), + (b"leftrightsquigarrow", "\u{21AD}"), + (b"leftthreetimes", "\u{22CB}"), + (b"leg", "\u{22DA}"), + (b"leq", "\u{2264}"), + (b"leqq", "\u{2266}"), + (b"leqslant", "\u{2A7D}"), + (b"les", "\u{2A7D}"), + (b"lescc", "\u{2AA8}"), + (b"lesdot", "\u{2A7F}"), + (b"lesdoto", "\u{2A81}"), + (b"lesdotor", "\u{2A83}"), + (b"lesg", "\u{22DA}\u{FE00}"), + (b"lesges", "\u{2A93}"), + (b"lessapprox", "\u{2A85}"), + (b"lessdot", "\u{22D6}"), + (b"lesseqgtr", "\u{22DA}"), + (b"lesseqqgtr", "\u{2A8B}"), + (b"lessgtr", "\u{2276}"), + (b"lesssim", "\u{2272}"), + (b"lfisht", "\u{297C}"), + (b"lfloor", "\u{230A}"), + (b"lfr", "\u{1D529}"), + (b"lg", "\u{2276}"), + (b"lgE", "\u{2A91}"), + (b"lhard", "\u{21BD}"), + (b"lharu", "\u{21BC}"), + (b"lharul", "\u{296A}"), + (b"lhblk", "\u{2584}"), + (b"ljcy", "\u{0459}"), + (b"ll", "\u{226A}"), + (b"llarr", "\u{21C7}"), + (b"llcorner", "\u{231E}"), + (b"llhard", "\u{296B}"), + (b"lltri", "\u{25FA}"), + (b"lmidot", "\u{0140}"), + (b"lmoust", "\u{23B0}"), + (b"lmoustache", "\u{23B0}"), + (b"lnE", "\u{2268}"), + (b"lnap", "\u{2A89}"), + (b"lnapprox", "\u{2A89}"), + (b"lne", "\u{2A87}"), + (b"lneq", "\u{2A87}"), + (b"lneqq", "\u{2268}"), + (b"lnsim", "\u{22E6}"), + (b"loang", "\u{27EC}"), + (b"loarr", "\u{21FD}"), + (b"lobrk", "\u{27E6}"), + (b"longleftarrow", "\u{27F5}"), + (b"longleftrightarrow", "\u{27F7}"), + (b"longmapsto", "\u{27FC}"), + (b"longrightarrow", "\u{27F6}"), + (b"looparrowleft", "\u{21AB}"), + (b"looparrowright", "\u{21AC}"), + (b"lopar", "\u{2985}"), + (b"lopf", "\u{1D55D}"), + (b"loplus", "\u{2A2D}"), + (b"lotimes", "\u{2A34}"), + (b"lowast", "\u{2217}"), + (b"lowbar", "\u{005F}"), + (b"loz", "\u{25CA}"), + (b"lozenge", "\u{25CA}"), + (b"lozf", "\u{29EB}"), + (b"lpar", "\u{0028}"), + (b"lparlt", "\u{2993}"), + (b"lrarr", "\u{21C6}"), + (b"lrcorner", "\u{231F}"), + (b"lrhar", "\u{21CB}"), + (b"lrhard", "\u{296D}"), + (b"lrm", "\u{200E}"), + (b"lrtri", "\u{22BF}"), + (b"lsaquo", "\u{2039}"), + (b"lscr", "\u{1D4C1}"), + (b"lsh", "\u{21B0}"), + (b"lsim", "\u{2272}"), + (b"lsime", "\u{2A8D}"), + (b"lsimg", "\u{2A8F}"), + (b"lsqb", "\u{005B}"), + (b"lsquo", "\u{2018}"), + (b"lsquor", "\u{201A}"), + (b"lstrok", "\u{0142}"), + (b"lt", "\u{003C}"), + (b"ltcc", "\u{2AA6}"), + (b"ltcir", "\u{2A79}"), + (b"ltdot", "\u{22D6}"), + (b"lthree", "\u{22CB}"), + (b"ltimes", "\u{22C9}"), + (b"ltlarr", "\u{2976}"), + (b"ltquest", "\u{2A7B}"), + (b"ltrPar", "\u{2996}"), + (b"ltri", "\u{25C3}"), + (b"ltrie", "\u{22B4}"), + (b"ltrif", "\u{25C2}"), + (b"lurdshar", "\u{294A}"), + (b"luruhar", "\u{2966}"), + (b"lvertneqq", "\u{2268}\u{FE00}"), + (b"lvnE", "\u{2268}\u{FE00}"), + (b"mDDot", "\u{223A}"), + (b"macr", "\u{00AF}"), + (b"male", "\u{2642}"), + (b"malt", "\u{2720}"), + (b"maltese", "\u{2720}"), + (b"map", "\u{21A6}"), + (b"mapsto", "\u{21A6}"), + (b"mapstodown", "\u{21A7}"), + (b"mapstoleft", "\u{21A4}"), + (b"mapstoup", "\u{21A5}"), + (b"marker", "\u{25AE}"), + (b"mcomma", "\u{2A29}"), + (b"mcy", "\u{043C}"), + (b"mdash", "\u{2014}"), + (b"measuredangle", "\u{2221}"), + (b"mfr", "\u{1D52A}"), + (b"mho", "\u{2127}"), + (b"micro", "\u{00B5}"), + (b"mid", "\u{2223}"), + (b"midast", "\u{002A}"), + (b"midcir", "\u{2AF0}"), + (b"middot", "\u{00B7}"), + (b"minus", "\u{2212}"), + (b"minusb", "\u{229F}"), + (b"minusd", "\u{2238}"), + (b"minusdu", "\u{2A2A}"), + (b"mlcp", "\u{2ADB}"), + (b"mldr", "\u{2026}"), + (b"mnplus", "\u{2213}"), + (b"models", "\u{22A7}"), + (b"mopf", "\u{1D55E}"), + (b"mp", "\u{2213}"), + (b"mscr", "\u{1D4C2}"), + (b"mstpos", "\u{223E}"), + (b"mu", "\u{03BC}"), + (b"multimap", "\u{22B8}"), + (b"mumap", "\u{22B8}"), + (b"nGg", "\u{22D9}\u{0338}"), + (b"nGt", "\u{226B}\u{20D2}"), + (b"nGtv", "\u{226B}\u{0338}"), + (b"nLeftarrow", "\u{21CD}"), + (b"nLeftrightarrow", "\u{21CE}"), + (b"nLl", "\u{22D8}\u{0338}"), + (b"nLt", "\u{226A}\u{20D2}"), + (b"nLtv", "\u{226A}\u{0338}"), + (b"nRightarrow", "\u{21CF}"), + (b"nVDash", "\u{22AF}"), + (b"nVdash", "\u{22AE}"), + (b"nabla", "\u{2207}"), + (b"nacute", "\u{0144}"), + (b"nang", "\u{2220}\u{20D2}"), + (b"nap", "\u{2249}"), + (b"napE", "\u{2A70}\u{0338}"), + (b"napid", "\u{224B}\u{0338}"), + (b"napos", "\u{0149}"), + (b"napprox", "\u{2249}"), + (b"natur", "\u{266E}"), + (b"natural", "\u{266E}"), + (b"naturals", "\u{2115}"), + (b"nbsp", "\u{00A0}"), + (b"nbump", "\u{224E}\u{0338}"), + (b"nbumpe", "\u{224F}\u{0338}"), + (b"ncap", "\u{2A43}"), + (b"ncaron", "\u{0148}"), + (b"ncedil", "\u{0146}"), + (b"ncong", "\u{2247}"), + (b"ncongdot", "\u{2A6D}\u{0338}"), + (b"ncup", "\u{2A42}"), + (b"ncy", "\u{043D}"), + (b"ndash", "\u{2013}"), + (b"ne", "\u{2260}"), + (b"neArr", "\u{21D7}"), + (b"nearhk", "\u{2924}"), + (b"nearr", "\u{2197}"), + (b"nearrow", "\u{2197}"), + (b"nedot", "\u{2250}\u{0338}"), + (b"nequiv", "\u{2262}"), + (b"nesear", "\u{2928}"), + (b"nesim", "\u{2242}\u{0338}"), + (b"nexist", "\u{2204}"), + (b"nexists", "\u{2204}"), + (b"nfr", "\u{1D52B}"), + (b"ngE", "\u{2267}\u{0338}"), + (b"nge", "\u{2271}"), + (b"ngeq", "\u{2271}"), + (b"ngeqq", "\u{2267}\u{0338}"), + (b"ngeqslant", "\u{2A7E}\u{0338}"), + (b"nges", "\u{2A7E}\u{0338}"), + (b"ngsim", "\u{2275}"), + (b"ngt", "\u{226F}"), + (b"ngtr", "\u{226F}"), + (b"nhArr", "\u{21CE}"), + (b"nharr", "\u{21AE}"), + (b"nhpar", "\u{2AF2}"), + (b"ni", "\u{220B}"), + (b"nis", "\u{22FC}"), + (b"nisd", "\u{22FA}"), + (b"niv", "\u{220B}"), + (b"njcy", "\u{045A}"), + (b"nlArr", "\u{21CD}"), + (b"nlE", "\u{2266}\u{0338}"), + (b"nlarr", "\u{219A}"), + (b"nldr", "\u{2025}"), + (b"nle", "\u{2270}"), + (b"nleftarrow", "\u{219A}"), + (b"nleftrightarrow", "\u{21AE}"), + (b"nleq", "\u{2270}"), + (b"nleqq", "\u{2266}\u{0338}"), + (b"nleqslant", "\u{2A7D}\u{0338}"), + (b"nles", "\u{2A7D}\u{0338}"), + (b"nless", "\u{226E}"), + (b"nlsim", "\u{2274}"), + (b"nlt", "\u{226E}"), + (b"nltri", "\u{22EA}"), + (b"nltrie", "\u{22EC}"), + (b"nmid", "\u{2224}"), + (b"nopf", "\u{1D55F}"), + (b"not", "\u{00AC}"), + (b"notin", "\u{2209}"), + (b"notinE", "\u{22F9}\u{0338}"), + (b"notindot", "\u{22F5}\u{0338}"), + (b"notinva", "\u{2209}"), + (b"notinvb", "\u{22F7}"), + (b"notinvc", "\u{22F6}"), + (b"notni", "\u{220C}"), + (b"notniva", "\u{220C}"), + (b"notnivb", "\u{22FE}"), + (b"notnivc", "\u{22FD}"), + (b"npar", "\u{2226}"), + (b"nparallel", "\u{2226}"), + (b"nparsl", "\u{2AFD}\u{20E5}"), + (b"npart", "\u{2202}\u{0338}"), + (b"npolint", "\u{2A14}"), + (b"npr", "\u{2280}"), + (b"nprcue", "\u{22E0}"), + (b"npre", "\u{2AAF}\u{0338}"), + (b"nprec", "\u{2280}"), + (b"npreceq", "\u{2AAF}\u{0338}"), + (b"nrArr", "\u{21CF}"), + (b"nrarr", "\u{219B}"), + (b"nrarrc", "\u{2933}\u{0338}"), + (b"nrarrw", "\u{219D}\u{0338}"), + (b"nrightarrow", "\u{219B}"), + (b"nrtri", "\u{22EB}"), + (b"nrtrie", "\u{22ED}"), + (b"nsc", "\u{2281}"), + (b"nsccue", "\u{22E1}"), + (b"nsce", "\u{2AB0}\u{0338}"), + (b"nscr", "\u{1D4C3}"), + (b"nshortmid", "\u{2224}"), + (b"nshortparallel", "\u{2226}"), + (b"nsim", "\u{2241}"), + (b"nsime", "\u{2244}"), + (b"nsimeq", "\u{2244}"), + (b"nsmid", "\u{2224}"), + (b"nspar", "\u{2226}"), + (b"nsqsube", "\u{22E2}"), + (b"nsqsupe", "\u{22E3}"), + (b"nsub", "\u{2284}"), + (b"nsubE", "\u{2AC5}\u{0338}"), + (b"nsube", "\u{2288}"), + (b"nsubset", "\u{2282}\u{20D2}"), + (b"nsubseteq", "\u{2288}"), + (b"nsubseteqq", "\u{2AC5}\u{0338}"), + (b"nsucc", "\u{2281}"), + (b"nsucceq", "\u{2AB0}\u{0338}"), + (b"nsup", "\u{2285}"), + (b"nsupE", "\u{2AC6}\u{0338}"), + (b"nsupe", "\u{2289}"), + (b"nsupset", "\u{2283}\u{20D2}"), + (b"nsupseteq", "\u{2289}"), + (b"nsupseteqq", "\u{2AC6}\u{0338}"), + (b"ntgl", "\u{2279}"), + (b"ntilde", "\u{00F1}"), + (b"ntlg", "\u{2278}"), + (b"ntriangleleft", "\u{22EA}"), + (b"ntrianglelefteq", "\u{22EC}"), + (b"ntriangleright", "\u{22EB}"), + (b"ntrianglerighteq", "\u{22ED}"), + (b"nu", "\u{03BD}"), + (b"num", "\u{0023}"), + (b"numero", "\u{2116}"), + (b"numsp", "\u{2007}"), + (b"nvDash", "\u{22AD}"), + (b"nvHarr", "\u{2904}"), + (b"nvap", "\u{224D}\u{20D2}"), + (b"nvdash", "\u{22AC}"), + (b"nvge", "\u{2265}\u{20D2}"), + (b"nvgt", "\u{003E}\u{20D2}"), + (b"nvinfin", "\u{29DE}"), + (b"nvlArr", "\u{2902}"), + (b"nvle", "\u{2264}\u{20D2}"), + (b"nvlt", "\u{003C}\u{20D2}"), + (b"nvltrie", "\u{22B4}\u{20D2}"), + (b"nvrArr", "\u{2903}"), + (b"nvrtrie", "\u{22B5}\u{20D2}"), + (b"nvsim", "\u{223C}\u{20D2}"), + (b"nwArr", "\u{21D6}"), + (b"nwarhk", "\u{2923}"), + (b"nwarr", "\u{2196}"), + (b"nwarrow", "\u{2196}"), + (b"nwnear", "\u{2927}"), + (b"oS", "\u{24C8}"), + (b"oacute", "\u{00F3}"), + (b"oast", "\u{229B}"), + (b"ocir", "\u{229A}"), + (b"ocirc", "\u{00F4}"), + (b"ocy", "\u{043E}"), + (b"odash", "\u{229D}"), + (b"odblac", "\u{0151}"), + (b"odiv", "\u{2A38}"), + (b"odot", "\u{2299}"), + (b"odsold", "\u{29BC}"), + (b"oelig", "\u{0153}"), + (b"ofcir", "\u{29BF}"), + (b"ofr", "\u{1D52C}"), + (b"ogon", "\u{02DB}"), + (b"ograve", "\u{00F2}"), + (b"ogt", "\u{29C1}"), + (b"ohbar", "\u{29B5}"), + (b"ohm", "\u{03A9}"), + (b"oint", "\u{222E}"), + (b"olarr", "\u{21BA}"), + (b"olcir", "\u{29BE}"), + (b"olcross", "\u{29BB}"), + (b"oline", "\u{203E}"), + (b"olt", "\u{29C0}"), + (b"omacr", "\u{014D}"), + (b"omega", "\u{03C9}"), + (b"omicron", "\u{03BF}"), + (b"omid", "\u{29B6}"), + (b"ominus", "\u{2296}"), + (b"oopf", "\u{1D560}"), + (b"opar", "\u{29B7}"), + (b"operp", "\u{29B9}"), + (b"oplus", "\u{2295}"), + (b"or", "\u{2228}"), + (b"orarr", "\u{21BB}"), + (b"ord", "\u{2A5D}"), + (b"order", "\u{2134}"), + (b"orderof", "\u{2134}"), + (b"ordf", "\u{00AA}"), + (b"ordm", "\u{00BA}"), + (b"origof", "\u{22B6}"), + (b"oror", "\u{2A56}"), + (b"orslope", "\u{2A57}"), + (b"orv", "\u{2A5B}"), + (b"oscr", "\u{2134}"), + (b"oslash", "\u{00F8}"), + (b"osol", "\u{2298}"), + (b"otilde", "\u{00F5}"), + (b"otimes", "\u{2297}"), + (b"otimesas", "\u{2A36}"), + (b"ouml", "\u{00F6}"), + (b"ovbar", "\u{233D}"), + (b"par", "\u{2225}"), + (b"para", "\u{00B6}"), + (b"parallel", "\u{2225}"), + (b"parsim", "\u{2AF3}"), + (b"parsl", "\u{2AFD}"), + (b"part", "\u{2202}"), + (b"pcy", "\u{043F}"), + (b"percnt", "\u{0025}"), + (b"period", "\u{002E}"), + (b"permil", "\u{2030}"), + (b"perp", "\u{22A5}"), + (b"pertenk", "\u{2031}"), + (b"pfr", "\u{1D52D}"), + (b"phi", "\u{03C6}"), + (b"phiv", "\u{03D5}"), + (b"phmmat", "\u{2133}"), + (b"phone", "\u{260E}"), + (b"pi", "\u{03C0}"), + (b"pitchfork", "\u{22D4}"), + (b"piv", "\u{03D6}"), + (b"planck", "\u{210F}"), + (b"planckh", "\u{210E}"), + (b"plankv", "\u{210F}"), + (b"plus", "\u{002B}"), + (b"plusacir", "\u{2A23}"), + (b"plusb", "\u{229E}"), + (b"pluscir", "\u{2A22}"), + (b"plusdo", "\u{2214}"), + (b"plusdu", "\u{2A25}"), + (b"pluse", "\u{2A72}"), + (b"plusmn", "\u{00B1}"), + (b"plussim", "\u{2A26}"), + (b"plustwo", "\u{2A27}"), + (b"pm", "\u{00B1}"), + (b"pointint", "\u{2A15}"), + (b"popf", "\u{1D561}"), + (b"pound", "\u{00A3}"), + (b"pr", "\u{227A}"), + (b"prE", "\u{2AB3}"), + (b"prap", "\u{2AB7}"), + (b"prcue", "\u{227C}"), + (b"pre", "\u{2AAF}"), + (b"prec", "\u{227A}"), + (b"precapprox", "\u{2AB7}"), + (b"preccurlyeq", "\u{227C}"), + (b"preceq", "\u{2AAF}"), + (b"precnapprox", "\u{2AB9}"), + (b"precneqq", "\u{2AB5}"), + (b"precnsim", "\u{22E8}"), + (b"precsim", "\u{227E}"), + (b"prime", "\u{2032}"), + (b"primes", "\u{2119}"), + (b"prnE", "\u{2AB5}"), + (b"prnap", "\u{2AB9}"), + (b"prnsim", "\u{22E8}"), + (b"prod", "\u{220F}"), + (b"profalar", "\u{232E}"), + (b"profline", "\u{2312}"), + (b"profsurf", "\u{2313}"), + (b"prop", "\u{221D}"), + (b"propto", "\u{221D}"), + (b"prsim", "\u{227E}"), + (b"prurel", "\u{22B0}"), + (b"pscr", "\u{1D4C5}"), + (b"psi", "\u{03C8}"), + (b"puncsp", "\u{2008}"), + (b"qfr", "\u{1D52E}"), + (b"qint", "\u{2A0C}"), + (b"qopf", "\u{1D562}"), + (b"qprime", "\u{2057}"), + (b"qscr", "\u{1D4C6}"), + (b"quaternions", "\u{210D}"), + (b"quatint", "\u{2A16}"), + (b"quest", "\u{003F}"), + (b"questeq", "\u{225F}"), + (b"quot", "\u{0022}"), + (b"rAarr", "\u{21DB}"), + (b"rArr", "\u{21D2}"), + (b"rAtail", "\u{291C}"), + (b"rBarr", "\u{290F}"), + (b"rHar", "\u{2964}"), + (b"race", "\u{223D}\u{0331}"), + (b"racute", "\u{0155}"), + (b"radic", "\u{221A}"), + (b"raemptyv", "\u{29B3}"), + (b"rang", "\u{27E9}"), + (b"rangd", "\u{2992}"), + (b"range", "\u{29A5}"), + (b"rangle", "\u{27E9}"), + (b"raquo", "\u{00BB}"), + (b"rarr", "\u{2192}"), + (b"rarrap", "\u{2975}"), + (b"rarrb", "\u{21E5}"), + (b"rarrbfs", "\u{2920}"), + (b"rarrc", "\u{2933}"), + (b"rarrfs", "\u{291E}"), + (b"rarrhk", "\u{21AA}"), + (b"rarrlp", "\u{21AC}"), + (b"rarrpl", "\u{2945}"), + (b"rarrsim", "\u{2974}"), + (b"rarrtl", "\u{21A3}"), + (b"rarrw", "\u{219D}"), + (b"ratail", "\u{291A}"), + (b"ratio", "\u{2236}"), + (b"rationals", "\u{211A}"), + (b"rbarr", "\u{290D}"), + (b"rbbrk", "\u{2773}"), + (b"rbrace", "\u{007D}"), + (b"rbrack", "\u{005D}"), + (b"rbrke", "\u{298C}"), + (b"rbrksld", "\u{298E}"), + (b"rbrkslu", "\u{2990}"), + (b"rcaron", "\u{0159}"), + (b"rcedil", "\u{0157}"), + (b"rceil", "\u{2309}"), + (b"rcub", "\u{007D}"), + (b"rcy", "\u{0440}"), + (b"rdca", "\u{2937}"), + (b"rdldhar", "\u{2969}"), + (b"rdquo", "\u{201D}"), + (b"rdquor", "\u{201D}"), + (b"rdsh", "\u{21B3}"), + (b"real", "\u{211C}"), + (b"realine", "\u{211B}"), + (b"realpart", "\u{211C}"), + (b"reals", "\u{211D}"), + (b"rect", "\u{25AD}"), + (b"reg", "\u{00AE}"), + (b"rfisht", "\u{297D}"), + (b"rfloor", "\u{230B}"), + (b"rfr", "\u{1D52F}"), + (b"rhard", "\u{21C1}"), + (b"rharu", "\u{21C0}"), + (b"rharul", "\u{296C}"), + (b"rho", "\u{03C1}"), + (b"rhov", "\u{03F1}"), + (b"rightarrow", "\u{2192}"), + (b"rightarrowtail", "\u{21A3}"), + (b"rightharpoondown", "\u{21C1}"), + (b"rightharpoonup", "\u{21C0}"), + (b"rightleftarrows", "\u{21C4}"), + (b"rightleftharpoons", "\u{21CC}"), + (b"rightrightarrows", "\u{21C9}"), + (b"rightsquigarrow", "\u{219D}"), + (b"rightthreetimes", "\u{22CC}"), + (b"ring", "\u{02DA}"), + (b"risingdotseq", "\u{2253}"), + (b"rlarr", "\u{21C4}"), + (b"rlhar", "\u{21CC}"), + (b"rlm", "\u{200F}"), + (b"rmoust", "\u{23B1}"), + (b"rmoustache", "\u{23B1}"), + (b"rnmid", "\u{2AEE}"), + (b"roang", "\u{27ED}"), + (b"roarr", "\u{21FE}"), + (b"robrk", "\u{27E7}"), + (b"ropar", "\u{2986}"), + (b"ropf", "\u{1D563}"), + (b"roplus", "\u{2A2E}"), + (b"rotimes", "\u{2A35}"), + (b"rpar", "\u{0029}"), + (b"rpargt", "\u{2994}"), + (b"rppolint", "\u{2A12}"), + (b"rrarr", "\u{21C9}"), + (b"rsaquo", "\u{203A}"), + (b"rscr", "\u{1D4C7}"), + (b"rsh", "\u{21B1}"), + (b"rsqb", "\u{005D}"), + (b"rsquo", "\u{2019}"), + (b"rsquor", "\u{2019}"), + (b"rthree", "\u{22CC}"), + (b"rtimes", "\u{22CA}"), + (b"rtri", "\u{25B9}"), + (b"rtrie", "\u{22B5}"), + (b"rtrif", "\u{25B8}"), + (b"rtriltri", "\u{29CE}"), + (b"ruluhar", "\u{2968}"), + (b"rx", "\u{211E}"), + (b"sacute", "\u{015B}"), + (b"sbquo", "\u{201A}"), + (b"sc", "\u{227B}"), + (b"scE", "\u{2AB4}"), + (b"scap", "\u{2AB8}"), + (b"scaron", "\u{0161}"), + (b"sccue", "\u{227D}"), + (b"sce", "\u{2AB0}"), + (b"scedil", "\u{015F}"), + (b"scirc", "\u{015D}"), + (b"scnE", "\u{2AB6}"), + (b"scnap", "\u{2ABA}"), + (b"scnsim", "\u{22E9}"), + (b"scpolint", "\u{2A13}"), + (b"scsim", "\u{227F}"), + (b"scy", "\u{0441}"), + (b"sdot", "\u{22C5}"), + (b"sdotb", "\u{22A1}"), + (b"sdote", "\u{2A66}"), + (b"seArr", "\u{21D8}"), + (b"searhk", "\u{2925}"), + (b"searr", "\u{2198}"), + (b"searrow", "\u{2198}"), + (b"sect", "\u{00A7}"), + (b"semi", "\u{003B}"), + (b"seswar", "\u{2929}"), + (b"setminus", "\u{2216}"), + (b"setmn", "\u{2216}"), + (b"sext", "\u{2736}"), + (b"sfr", "\u{1D530}"), + (b"sfrown", "\u{2322}"), + (b"sharp", "\u{266F}"), + (b"shchcy", "\u{0449}"), + (b"shcy", "\u{0448}"), + (b"shortmid", "\u{2223}"), + (b"shortparallel", "\u{2225}"), + (b"shy", "\u{00AD}"), + (b"sigma", "\u{03C3}"), + (b"sigmaf", "\u{03C2}"), + (b"sigmav", "\u{03C2}"), + (b"sim", "\u{223C}"), + (b"simdot", "\u{2A6A}"), + (b"sime", "\u{2243}"), + (b"simeq", "\u{2243}"), + (b"simg", "\u{2A9E}"), + (b"simgE", "\u{2AA0}"), + (b"siml", "\u{2A9D}"), + (b"simlE", "\u{2A9F}"), + (b"simne", "\u{2246}"), + (b"simplus", "\u{2A24}"), + (b"simrarr", "\u{2972}"), + (b"slarr", "\u{2190}"), + (b"smallsetminus", "\u{2216}"), + (b"smashp", "\u{2A33}"), + (b"smeparsl", "\u{29E4}"), + (b"smid", "\u{2223}"), + (b"smile", "\u{2323}"), + (b"smt", "\u{2AAA}"), + (b"smte", "\u{2AAC}"), + (b"smtes", "\u{2AAC}\u{FE00}"), + (b"softcy", "\u{044C}"), + (b"sol", "\u{002F}"), + (b"solb", "\u{29C4}"), + (b"solbar", "\u{233F}"), + (b"sopf", "\u{1D564}"), + (b"spades", "\u{2660}"), + (b"spadesuit", "\u{2660}"), + (b"spar", "\u{2225}"), + (b"sqcap", "\u{2293}"), + (b"sqcaps", "\u{2293}\u{FE00}"), + (b"sqcup", "\u{2294}"), + (b"sqcups", "\u{2294}\u{FE00}"), + (b"sqsub", "\u{228F}"), + (b"sqsube", "\u{2291}"), + (b"sqsubset", "\u{228F}"), + (b"sqsubseteq", "\u{2291}"), + (b"sqsup", "\u{2290}"), + (b"sqsupe", "\u{2292}"), + (b"sqsupset", "\u{2290}"), + (b"sqsupseteq", "\u{2292}"), + (b"squ", "\u{25A1}"), + (b"square", "\u{25A1}"), + (b"squarf", "\u{25AA}"), + (b"squf", "\u{25AA}"), + (b"srarr", "\u{2192}"), + (b"sscr", "\u{1D4C8}"), + (b"ssetmn", "\u{2216}"), + (b"ssmile", "\u{2323}"), + (b"sstarf", "\u{22C6}"), + (b"star", "\u{2606}"), + (b"starf", "\u{2605}"), + (b"straightepsilon", "\u{03F5}"), + (b"straightphi", "\u{03D5}"), + (b"strns", "\u{00AF}"), + (b"sub", "\u{2282}"), + (b"subE", "\u{2AC5}"), + (b"subdot", "\u{2ABD}"), + (b"sube", "\u{2286}"), + (b"subedot", "\u{2AC3}"), + (b"submult", "\u{2AC1}"), + (b"subnE", "\u{2ACB}"), + (b"subne", "\u{228A}"), + (b"subplus", "\u{2ABF}"), + (b"subrarr", "\u{2979}"), + (b"subset", "\u{2282}"), + (b"subseteq", "\u{2286}"), + (b"subseteqq", "\u{2AC5}"), + (b"subsetneq", "\u{228A}"), + (b"subsetneqq", "\u{2ACB}"), + (b"subsim", "\u{2AC7}"), + (b"subsub", "\u{2AD5}"), + (b"subsup", "\u{2AD3}"), + (b"succ", "\u{227B}"), + (b"succapprox", "\u{2AB8}"), + (b"succcurlyeq", "\u{227D}"), + (b"succeq", "\u{2AB0}"), + (b"succnapprox", "\u{2ABA}"), + (b"succneqq", "\u{2AB6}"), + (b"succnsim", "\u{22E9}"), + (b"succsim", "\u{227F}"), + (b"sum", "\u{2211}"), + (b"sung", "\u{266A}"), + (b"sup", "\u{2283}"), + (b"sup1", "\u{00B9}"), + (b"sup2", "\u{00B2}"), + (b"sup3", "\u{00B3}"), + (b"supE", "\u{2AC6}"), + (b"supdot", "\u{2ABE}"), + (b"supdsub", "\u{2AD8}"), + (b"supe", "\u{2287}"), + (b"supedot", "\u{2AC4}"), + (b"suphsol", "\u{27C9}"), + (b"suphsub", "\u{2AD7}"), + (b"suplarr", "\u{297B}"), + (b"supmult", "\u{2AC2}"), + (b"supnE", "\u{2ACC}"), + (b"supne", "\u{228B}"), + (b"supplus", "\u{2AC0}"), + (b"supset", "\u{2283}"), + (b"supseteq", "\u{2287}"), + (b"supseteqq", "\u{2AC6}"), + (b"supsetneq", "\u{228B}"), + (b"supsetneqq", "\u{2ACC}"), + (b"supsim", "\u{2AC8}"), + (b"supsub", "\u{2AD4}"), + (b"supsup", "\u{2AD6}"), + (b"swArr", "\u{21D9}"), + (b"swarhk", "\u{2926}"), + (b"swarr", "\u{2199}"), + (b"swarrow", "\u{2199}"), + (b"swnwar", "\u{292A}"), + (b"szlig", "\u{00DF}"), + (b"target", "\u{2316}"), + (b"tau", "\u{03C4}"), + (b"tbrk", "\u{23B4}"), + (b"tcaron", "\u{0165}"), + (b"tcedil", "\u{0163}"), + (b"tcy", "\u{0442}"), + (b"tdot", "\u{20DB}"), + (b"telrec", "\u{2315}"), + (b"tfr", "\u{1D531}"), + (b"there4", "\u{2234}"), + (b"therefore", "\u{2234}"), + (b"theta", "\u{03B8}"), + (b"thetasym", "\u{03D1}"), + (b"thetav", "\u{03D1}"), + (b"thickapprox", "\u{2248}"), + (b"thicksim", "\u{223C}"), + (b"thinsp", "\u{2009}"), + (b"thkap", "\u{2248}"), + (b"thksim", "\u{223C}"), + (b"thorn", "\u{00FE}"), + (b"tilde", "\u{02DC}"), + (b"times", "\u{00D7}"), + (b"timesb", "\u{22A0}"), + (b"timesbar", "\u{2A31}"), + (b"timesd", "\u{2A30}"), + (b"tint", "\u{222D}"), + (b"toea", "\u{2928}"), + (b"top", "\u{22A4}"), + (b"topbot", "\u{2336}"), + (b"topcir", "\u{2AF1}"), + (b"topf", "\u{1D565}"), + (b"topfork", "\u{2ADA}"), + (b"tosa", "\u{2929}"), + (b"tprime", "\u{2034}"), + (b"trade", "\u{2122}"), + (b"triangle", "\u{25B5}"), + (b"triangledown", "\u{25BF}"), + (b"triangleleft", "\u{25C3}"), + (b"trianglelefteq", "\u{22B4}"), + (b"triangleq", "\u{225C}"), + (b"triangleright", "\u{25B9}"), + (b"trianglerighteq", "\u{22B5}"), + (b"tridot", "\u{25EC}"), + (b"trie", "\u{225C}"), + (b"triminus", "\u{2A3A}"), + (b"triplus", "\u{2A39}"), + (b"trisb", "\u{29CD}"), + (b"tritime", "\u{2A3B}"), + (b"trpezium", "\u{23E2}"), + (b"tscr", "\u{1D4C9}"), + (b"tscy", "\u{0446}"), + (b"tshcy", "\u{045B}"), + (b"tstrok", "\u{0167}"), + (b"twixt", "\u{226C}"), + (b"twoheadleftarrow", "\u{219E}"), + (b"twoheadrightarrow", "\u{21A0}"), + (b"uArr", "\u{21D1}"), + (b"uHar", "\u{2963}"), + (b"uacute", "\u{00FA}"), + (b"uarr", "\u{2191}"), + (b"ubrcy", "\u{045E}"), + (b"ubreve", "\u{016D}"), + (b"ucirc", "\u{00FB}"), + (b"ucy", "\u{0443}"), + (b"udarr", "\u{21C5}"), + (b"udblac", "\u{0171}"), + (b"udhar", "\u{296E}"), + (b"ufisht", "\u{297E}"), + (b"ufr", "\u{1D532}"), + (b"ugrave", "\u{00F9}"), + (b"uharl", "\u{21BF}"), + (b"uharr", "\u{21BE}"), + (b"uhblk", "\u{2580}"), + (b"ulcorn", "\u{231C}"), + (b"ulcorner", "\u{231C}"), + (b"ulcrop", "\u{230F}"), + (b"ultri", "\u{25F8}"), + (b"umacr", "\u{016B}"), + (b"uml", "\u{00A8}"), + (b"uogon", "\u{0173}"), + (b"uopf", "\u{1D566}"), + (b"uparrow", "\u{2191}"), + (b"updownarrow", "\u{2195}"), + (b"upharpoonleft", "\u{21BF}"), + (b"upharpoonright", "\u{21BE}"), + (b"uplus", "\u{228E}"), + (b"upsi", "\u{03C5}"), + (b"upsih", "\u{03D2}"), + (b"upsilon", "\u{03C5}"), + (b"upuparrows", "\u{21C8}"), + (b"urcorn", "\u{231D}"), + (b"urcorner", "\u{231D}"), + (b"urcrop", "\u{230E}"), + (b"uring", "\u{016F}"), + (b"urtri", "\u{25F9}"), + (b"uscr", "\u{1D4CA}"), + (b"utdot", "\u{22F0}"), + (b"utilde", "\u{0169}"), + (b"utri", "\u{25B5}"), + (b"utrif", "\u{25B4}"), + (b"uuarr", "\u{21C8}"), + (b"uuml", "\u{00FC}"), + (b"uwangle", "\u{29A7}"), + (b"vArr", "\u{21D5}"), + (b"vBar", "\u{2AE8}"), + (b"vBarv", "\u{2AE9}"), + (b"vDash", "\u{22A8}"), + (b"vangrt", "\u{299C}"), + (b"varepsilon", "\u{03F5}"), + (b"varkappa", "\u{03F0}"), + (b"varnothing", "\u{2205}"), + (b"varphi", "\u{03D5}"), + (b"varpi", "\u{03D6}"), + (b"varpropto", "\u{221D}"), + (b"varr", "\u{2195}"), + (b"varrho", "\u{03F1}"), + (b"varsigma", "\u{03C2}"), + (b"varsubsetneq", "\u{228A}\u{FE00}"), + (b"varsubsetneqq", "\u{2ACB}\u{FE00}"), + (b"varsupsetneq", "\u{228B}\u{FE00}"), + (b"varsupsetneqq", "\u{2ACC}\u{FE00}"), + (b"vartheta", "\u{03D1}"), + (b"vartriangleleft", "\u{22B2}"), + (b"vartriangleright", "\u{22B3}"), + (b"vcy", "\u{0432}"), + (b"vdash", "\u{22A2}"), + (b"vee", "\u{2228}"), + (b"veebar", "\u{22BB}"), + (b"veeeq", "\u{225A}"), + (b"vellip", "\u{22EE}"), + (b"verbar", "\u{007C}"), + (b"vert", "\u{007C}"), + (b"vfr", "\u{1D533}"), + (b"vltri", "\u{22B2}"), + (b"vnsub", "\u{2282}\u{20D2}"), + (b"vnsup", "\u{2283}\u{20D2}"), + (b"vopf", "\u{1D567}"), + (b"vprop", "\u{221D}"), + (b"vrtri", "\u{22B3}"), + (b"vscr", "\u{1D4CB}"), + (b"vsubnE", "\u{2ACB}\u{FE00}"), + (b"vsubne", "\u{228A}\u{FE00}"), + (b"vsupnE", "\u{2ACC}\u{FE00}"), + (b"vsupne", "\u{228B}\u{FE00}"), + (b"vzigzag", "\u{299A}"), + (b"wcirc", "\u{0175}"), + (b"wedbar", "\u{2A5F}"), + (b"wedge", "\u{2227}"), + (b"wedgeq", "\u{2259}"), + (b"weierp", "\u{2118}"), + (b"wfr", "\u{1D534}"), + (b"wopf", "\u{1D568}"), + (b"wp", "\u{2118}"), + (b"wr", "\u{2240}"), + (b"wreath", "\u{2240}"), + (b"wscr", "\u{1D4CC}"), + (b"xcap", "\u{22C2}"), + (b"xcirc", "\u{25EF}"), + (b"xcup", "\u{22C3}"), + (b"xdtri", "\u{25BD}"), + (b"xfr", "\u{1D535}"), + (b"xhArr", "\u{27FA}"), + (b"xharr", "\u{27F7}"), + (b"xi", "\u{03BE}"), + (b"xlArr", "\u{27F8}"), + (b"xlarr", "\u{27F5}"), + (b"xmap", "\u{27FC}"), + (b"xnis", "\u{22FB}"), + (b"xodot", "\u{2A00}"), + (b"xopf", "\u{1D569}"), + (b"xoplus", "\u{2A01}"), + (b"xotime", "\u{2A02}"), + (b"xrArr", "\u{27F9}"), + (b"xrarr", "\u{27F6}"), + (b"xscr", "\u{1D4CD}"), + (b"xsqcup", "\u{2A06}"), + (b"xuplus", "\u{2A04}"), + (b"xutri", "\u{25B3}"), + (b"xvee", "\u{22C1}"), + (b"xwedge", "\u{22C0}"), + (b"yacute", "\u{00FD}"), + (b"yacy", "\u{044F}"), + (b"ycirc", "\u{0177}"), + (b"ycy", "\u{044B}"), + (b"yen", "\u{00A5}"), + (b"yfr", "\u{1D536}"), + (b"yicy", "\u{0457}"), + (b"yopf", "\u{1D56A}"), + (b"yscr", "\u{1D4CE}"), + (b"yucy", "\u{044E}"), + (b"yuml", "\u{00FF}"), + (b"zacute", "\u{017A}"), + (b"zcaron", "\u{017E}"), + (b"zcy", "\u{0437}"), + (b"zdot", "\u{017C}"), + (b"zeetrf", "\u{2128}"), + (b"zeta", "\u{03B6}"), + (b"zfr", "\u{1D537}"), + (b"zhcy", "\u{0436}"), + (b"zigrarr", "\u{21DD}"), + (b"zopf", "\u{1D56B}"), + (b"zscr", "\u{1D4CF}"), + (b"zwj", "\u{200D}"), + (b"zwnj", "\u{200C}"), +]; -const ENTITY_VALUES: [&'static str; 2125] = [ - "\u{00C6}", - "\u{0026}", - "\u{00C1}", - "\u{0102}", - "\u{00C2}", - "\u{0410}", - "\u{1D504}", - "\u{00C0}", - "\u{0391}", - "\u{0100}", - "\u{2A53}", - "\u{0104}", - "\u{1D538}", - "\u{2061}", - "\u{00C5}", - "\u{1D49C}", - "\u{2254}", - "\u{00C3}", - "\u{00C4}", - "\u{2216}", - "\u{2AE7}", - "\u{2306}", - "\u{0411}", - "\u{2235}", - "\u{212C}", - "\u{0392}", - "\u{1D505}", - "\u{1D539}", - "\u{02D8}", - "\u{212C}", - "\u{224E}", - "\u{0427}", - "\u{00A9}", - "\u{0106}", - "\u{22D2}", - "\u{2145}", - "\u{212D}", - "\u{010C}", - "\u{00C7}", - "\u{0108}", - "\u{2230}", - "\u{010A}", - "\u{00B8}", - "\u{00B7}", - "\u{212D}", - "\u{03A7}", - "\u{2299}", - "\u{2296}", - "\u{2295}", - "\u{2297}", - "\u{2232}", - "\u{201D}", - "\u{2019}", - "\u{2237}", - "\u{2A74}", - "\u{2261}", - "\u{222F}", - "\u{222E}", - "\u{2102}", - "\u{2210}", - "\u{2233}", - "\u{2A2F}", - "\u{1D49E}", - "\u{22D3}", - "\u{224D}", - "\u{2145}", - "\u{2911}", - "\u{0402}", - "\u{0405}", - "\u{040F}", - "\u{2021}", - "\u{21A1}", - "\u{2AE4}", - "\u{010E}", - "\u{0414}", - "\u{2207}", - "\u{0394}", - "\u{1D507}", - "\u{00B4}", - "\u{02D9}", - "\u{02DD}", - "\u{0060}", - "\u{02DC}", - "\u{22C4}", - "\u{2146}", - "\u{1D53B}", - "\u{00A8}", - "\u{20DC}", - "\u{2250}", - "\u{222F}", - "\u{00A8}", - "\u{21D3}", - "\u{21D0}", - "\u{21D4}", - "\u{2AE4}", - "\u{27F8}", - "\u{27FA}", - "\u{27F9}", - "\u{21D2}", - "\u{22A8}", - "\u{21D1}", - "\u{21D5}", - "\u{2225}", - "\u{2193}", - "\u{2913}", - "\u{21F5}", - "\u{0311}", - "\u{2950}", - "\u{295E}", - "\u{21BD}", - "\u{2956}", - "\u{295F}", - "\u{21C1}", - "\u{2957}", - "\u{22A4}", - "\u{21A7}", - "\u{21D3}", - "\u{1D49F}", - "\u{0110}", - "\u{014A}", - "\u{00D0}", - "\u{00C9}", - "\u{011A}", - "\u{00CA}", - "\u{042D}", - "\u{0116}", - "\u{1D508}", - "\u{00C8}", - "\u{2208}", - "\u{0112}", - "\u{25FB}", - "\u{25AB}", - "\u{0118}", - "\u{1D53C}", - "\u{0395}", - "\u{2A75}", - "\u{2242}", - "\u{21CC}", - "\u{2130}", - "\u{2A73}", - "\u{0397}", - "\u{00CB}", - "\u{2203}", - "\u{2147}", - "\u{0424}", - "\u{1D509}", - "\u{25FC}", - "\u{25AA}", - "\u{1D53D}", - "\u{2200}", - "\u{2131}", - "\u{2131}", - "\u{0403}", - "\u{003E}", - "\u{0393}", - "\u{03DC}", - "\u{011E}", - "\u{0122}", - "\u{011C}", - "\u{0413}", - "\u{0120}", - "\u{1D50A}", - "\u{22D9}", - "\u{1D53E}", - "\u{2265}", - "\u{22DB}", - "\u{2267}", - "\u{2AA2}", - "\u{2277}", - "\u{2A7E}", - "\u{2273}", - "\u{1D4A2}", - "\u{226B}", - "\u{042A}", - "\u{02C7}", - "\u{005E}", - "\u{0124}", - "\u{210C}", - "\u{210B}", - "\u{210D}", - "\u{2500}", - "\u{210B}", - "\u{0126}", - "\u{224E}", - "\u{224F}", - "\u{0415}", - "\u{0132}", - "\u{0401}", - "\u{00CD}", - "\u{00CE}", - "\u{0418}", - "\u{0130}", - "\u{2111}", - "\u{00CC}", - "\u{2111}", - "\u{012A}", - "\u{2148}", - "\u{21D2}", - "\u{222C}", - "\u{222B}", - "\u{22C2}", - "\u{2063}", - "\u{2062}", - "\u{012E}", - "\u{1D540}", - "\u{0399}", - "\u{2110}", - "\u{0128}", - "\u{0406}", - "\u{00CF}", - "\u{0134}", - "\u{0419}", - "\u{1D50D}", - "\u{1D541}", - "\u{1D4A5}", - "\u{0408}", - "\u{0404}", - "\u{0425}", - "\u{040C}", - "\u{039A}", - "\u{0136}", - "\u{041A}", - "\u{1D50E}", - "\u{1D542}", - "\u{1D4A6}", - "\u{0409}", - "\u{003C}", - "\u{0139}", - "\u{039B}", - "\u{27EA}", - "\u{2112}", - "\u{219E}", - "\u{013D}", - "\u{013B}", - "\u{041B}", - "\u{27E8}", - "\u{2190}", - "\u{21E4}", - "\u{21C6}", - "\u{2308}", - "\u{27E6}", - "\u{2961}", - "\u{21C3}", - "\u{2959}", - "\u{230A}", - "\u{2194}", - "\u{294E}", - "\u{22A3}", - "\u{21A4}", - "\u{295A}", - "\u{22B2}", - "\u{29CF}", - "\u{22B4}", - "\u{2951}", - "\u{2960}", - "\u{21BF}", - "\u{2958}", - "\u{21BC}", - "\u{2952}", - "\u{21D0}", - "\u{21D4}", - "\u{22DA}", - "\u{2266}", - "\u{2276}", - "\u{2AA1}", - "\u{2A7D}", - "\u{2272}", - "\u{1D50F}", - "\u{22D8}", - "\u{21DA}", - "\u{013F}", - "\u{27F5}", - "\u{27F7}", - "\u{27F6}", - "\u{27F8}", - "\u{27FA}", - "\u{27F9}", - "\u{1D543}", - "\u{2199}", - "\u{2198}", - "\u{2112}", - "\u{21B0}", - "\u{0141}", - "\u{226A}", - "\u{2905}", - "\u{041C}", - "\u{205F}", - "\u{2133}", - "\u{1D510}", - "\u{2213}", - "\u{1D544}", - "\u{2133}", - "\u{039C}", - "\u{040A}", - "\u{0143}", - "\u{0147}", - "\u{0145}", - "\u{041D}", - "\u{200B}", - "\u{200B}", - "\u{200B}", - "\u{200B}", - "\u{226B}", - "\u{226A}", - "\u{000A}", - "\u{1D511}", - "\u{2060}", - "\u{00A0}", - "\u{2115}", - "\u{2AEC}", - "\u{2262}", - "\u{226D}", - "\u{2226}", - "\u{2209}", - "\u{2260}", - "\u{2242}\u{0338}", - "\u{2204}", - "\u{226F}", - "\u{2271}", - "\u{2267}\u{0338}", - "\u{226B}\u{0338}", - "\u{2279}", - "\u{2A7E}\u{0338}", - "\u{2275}", - "\u{224E}\u{0338}", - "\u{224F}\u{0338}", - "\u{22EA}", - "\u{29CF}\u{0338}", - "\u{22EC}", - "\u{226E}", - "\u{2270}", - "\u{2278}", - "\u{226A}\u{0338}", - "\u{2A7D}\u{0338}", - "\u{2274}", - "\u{2AA2}\u{0338}", - "\u{2AA1}\u{0338}", - "\u{2280}", - "\u{2AAF}\u{0338}", - "\u{22E0}", - "\u{220C}", - "\u{22EB}", - "\u{29D0}\u{0338}", - "\u{22ED}", - "\u{228F}\u{0338}", - "\u{22E2}", - "\u{2290}\u{0338}", - "\u{22E3}", - "\u{2282}\u{20D2}", - "\u{2288}", - "\u{2281}", - "\u{2AB0}\u{0338}", - "\u{22E1}", - "\u{227F}\u{0338}", - "\u{2283}\u{20D2}", - "\u{2289}", - "\u{2241}", - "\u{2244}", - "\u{2247}", - "\u{2249}", - "\u{2224}", - "\u{1D4A9}", - "\u{00D1}", - "\u{039D}", - "\u{0152}", - "\u{00D3}", - "\u{00D4}", - "\u{041E}", - "\u{0150}", - "\u{1D512}", - "\u{00D2}", - "\u{014C}", - "\u{03A9}", - "\u{039F}", - "\u{1D546}", - "\u{201C}", - "\u{2018}", - "\u{2A54}", - "\u{1D4AA}", - "\u{00D8}", - "\u{00D5}", - "\u{2A37}", - "\u{00D6}", - "\u{203E}", - "\u{23DE}", - "\u{23B4}", - "\u{23DC}", - "\u{2202}", - "\u{041F}", - "\u{1D513}", - "\u{03A6}", - "\u{03A0}", - "\u{00B1}", - "\u{210C}", - "\u{2119}", - "\u{2ABB}", - "\u{227A}", - "\u{2AAF}", - "\u{227C}", - "\u{227E}", - "\u{2033}", - "\u{220F}", - "\u{2237}", - "\u{221D}", - "\u{1D4AB}", - "\u{03A8}", - "\u{0022}", - "\u{1D514}", - "\u{211A}", - "\u{1D4AC}", - "\u{2910}", - "\u{00AE}", - "\u{0154}", - "\u{27EB}", - "\u{21A0}", - "\u{2916}", - "\u{0158}", - "\u{0156}", - "\u{0420}", - "\u{211C}", - "\u{220B}", - "\u{21CB}", - "\u{296F}", - "\u{211C}", - "\u{03A1}", - "\u{27E9}", - "\u{2192}", - "\u{21E5}", - "\u{21C4}", - "\u{2309}", - "\u{27E7}", - "\u{295D}", - "\u{21C2}", - "\u{2955}", - "\u{230B}", - "\u{22A2}", - "\u{21A6}", - "\u{295B}", - "\u{22B3}", - "\u{29D0}", - "\u{22B5}", - "\u{294F}", - "\u{295C}", - "\u{21BE}", - "\u{2954}", - "\u{21C0}", - "\u{2953}", - "\u{21D2}", - "\u{211D}", - "\u{2970}", - "\u{21DB}", - "\u{211B}", - "\u{21B1}", - "\u{29F4}", - "\u{0429}", - "\u{0428}", - "\u{042C}", - "\u{015A}", - "\u{2ABC}", - "\u{0160}", - "\u{015E}", - "\u{015C}", - "\u{0421}", - "\u{1D516}", - "\u{2193}", - "\u{2190}", - "\u{2192}", - "\u{2191}", - "\u{03A3}", - "\u{2218}", - "\u{1D54A}", - "\u{221A}", - "\u{25A1}", - "\u{2293}", - "\u{228F}", - "\u{2291}", - "\u{2290}", - "\u{2292}", - "\u{2294}", - "\u{1D4AE}", - "\u{22C6}", - "\u{22D0}", - "\u{22D0}", - "\u{2286}", - "\u{227B}", - "\u{2AB0}", - "\u{227D}", - "\u{227F}", - "\u{220B}", - "\u{2211}", - "\u{22D1}", - "\u{2283}", - "\u{2287}", - "\u{22D1}", - "\u{00DE}", - "\u{2122}", - "\u{040B}", - "\u{0426}", - "\u{0009}", - "\u{03A4}", - "\u{0164}", - "\u{0162}", - "\u{0422}", - "\u{1D517}", - "\u{2234}", - "\u{0398}", - "\u{205F}\u{200A}", - "\u{2009}", - "\u{223C}", - "\u{2243}", - "\u{2245}", - "\u{2248}", - "\u{1D54B}", - "\u{20DB}", - "\u{1D4AF}", - "\u{0166}", - "\u{00DA}", - "\u{219F}", - "\u{2949}", - "\u{040E}", - "\u{016C}", - "\u{00DB}", - "\u{0423}", - "\u{0170}", - "\u{1D518}", - "\u{00D9}", - "\u{016A}", - "\u{005F}", - "\u{23DF}", - "\u{23B5}", - "\u{23DD}", - "\u{22C3}", - "\u{228E}", - "\u{0172}", - "\u{1D54C}", - "\u{2191}", - "\u{2912}", - "\u{21C5}", - "\u{2195}", - "\u{296E}", - "\u{22A5}", - "\u{21A5}", - "\u{21D1}", - "\u{21D5}", - "\u{2196}", - "\u{2197}", - "\u{03D2}", - "\u{03A5}", - "\u{016E}", - "\u{1D4B0}", - "\u{0168}", - "\u{00DC}", - "\u{22AB}", - "\u{2AEB}", - "\u{0412}", - "\u{22A9}", - "\u{2AE6}", - "\u{22C1}", - "\u{2016}", - "\u{2016}", - "\u{2223}", - "\u{007C}", - "\u{2758}", - "\u{2240}", - "\u{200A}", - "\u{1D519}", - "\u{1D54D}", - "\u{1D4B1}", - "\u{22AA}", - "\u{0174}", - "\u{22C0}", - "\u{1D51A}", - "\u{1D54E}", - "\u{1D4B2}", - "\u{1D51B}", - "\u{039E}", - "\u{1D54F}", - "\u{1D4B3}", - "\u{042F}", - "\u{0407}", - "\u{042E}", - "\u{00DD}", - "\u{0176}", - "\u{042B}", - "\u{1D51C}", - "\u{1D550}", - "\u{1D4B4}", - "\u{0178}", - "\u{0416}", - "\u{0179}", - "\u{017D}", - "\u{0417}", - "\u{017B}", - "\u{200B}", - "\u{0396}", - "\u{2128}", - "\u{2124}", - "\u{1D4B5}", - "\u{00E1}", - "\u{0103}", - "\u{223E}", - "\u{223E}\u{0333}", - "\u{223F}", - "\u{00E2}", - "\u{00B4}", - "\u{0430}", - "\u{00E6}", - "\u{2061}", - "\u{1D51E}", - "\u{00E0}", - "\u{2135}", - "\u{2135}", - "\u{03B1}", - "\u{0101}", - "\u{2A3F}", - "\u{0026}", - "\u{2227}", - "\u{2A55}", - "\u{2A5C}", - "\u{2A58}", - "\u{2A5A}", - "\u{2220}", - "\u{29A4}", - "\u{2220}", - "\u{2221}", - "\u{29A8}", - "\u{29A9}", - "\u{29AA}", - "\u{29AB}", - "\u{29AC}", - "\u{29AD}", - "\u{29AE}", - "\u{29AF}", - "\u{221F}", - "\u{22BE}", - "\u{299D}", - "\u{2222}", - "\u{00C5}", - "\u{237C}", - "\u{0105}", - "\u{1D552}", - "\u{2248}", - "\u{2A70}", - "\u{2A6F}", - "\u{224A}", - "\u{224B}", - "\u{0027}", - "\u{2248}", - "\u{224A}", - "\u{00E5}", - "\u{1D4B6}", - "\u{002A}", - "\u{2248}", - "\u{224D}", - "\u{00E3}", - "\u{00E4}", - "\u{2233}", - "\u{2A11}", - "\u{2AED}", - "\u{224C}", - "\u{03F6}", - "\u{2035}", - "\u{223D}", - "\u{22CD}", - "\u{22BD}", - "\u{2305}", - "\u{2305}", - "\u{23B5}", - "\u{23B6}", - "\u{224C}", - "\u{0431}", - "\u{201E}", - "\u{2235}", - "\u{2235}", - "\u{29B0}", - "\u{03F6}", - "\u{212C}", - "\u{03B2}", - "\u{2136}", - "\u{226C}", - "\u{1D51F}", - "\u{22C2}", - "\u{25EF}", - "\u{22C3}", - "\u{2A00}", - "\u{2A01}", - "\u{2A02}", - "\u{2A06}", - "\u{2605}", - "\u{25BD}", - "\u{25B3}", - "\u{2A04}", - "\u{22C1}", - "\u{22C0}", - "\u{290D}", - "\u{29EB}", - "\u{25AA}", - "\u{25B4}", - "\u{25BE}", - "\u{25C2}", - "\u{25B8}", - "\u{2423}", - "\u{2592}", - "\u{2591}", - "\u{2593}", - "\u{2588}", - "\u{003D}\u{20E5}", - "\u{2261}\u{20E5}", - "\u{2310}", - "\u{1D553}", - "\u{22A5}", - "\u{22A5}", - "\u{22C8}", - "\u{2557}", - "\u{2554}", - "\u{2556}", - "\u{2553}", - "\u{2550}", - "\u{2566}", - "\u{2569}", - "\u{2564}", - "\u{2567}", - "\u{255D}", - "\u{255A}", - "\u{255C}", - "\u{2559}", - "\u{2551}", - "\u{256C}", - "\u{2563}", - "\u{2560}", - "\u{256B}", - "\u{2562}", - "\u{255F}", - "\u{29C9}", - "\u{2555}", - "\u{2552}", - "\u{2510}", - "\u{250C}", - "\u{2500}", - "\u{2565}", - "\u{2568}", - "\u{252C}", - "\u{2534}", - "\u{229F}", - "\u{229E}", - "\u{22A0}", - "\u{255B}", - "\u{2558}", - "\u{2518}", - "\u{2514}", - "\u{2502}", - "\u{256A}", - "\u{2561}", - "\u{255E}", - "\u{253C}", - "\u{2524}", - "\u{251C}", - "\u{2035}", - "\u{02D8}", - "\u{00A6}", - "\u{1D4B7}", - "\u{204F}", - "\u{223D}", - "\u{22CD}", - "\u{005C}", - "\u{29C5}", - "\u{27C8}", - "\u{2022}", - "\u{2022}", - "\u{224E}", - "\u{2AAE}", - "\u{224F}", - "\u{224F}", - "\u{0107}", - "\u{2229}", - "\u{2A44}", - "\u{2A49}", - "\u{2A4B}", - "\u{2A47}", - "\u{2A40}", - "\u{2229}\u{FE00}", - "\u{2041}", - "\u{02C7}", - "\u{2A4D}", - "\u{010D}", - "\u{00E7}", - "\u{0109}", - "\u{2A4C}", - "\u{2A50}", - "\u{010B}", - "\u{00B8}", - "\u{29B2}", - "\u{00A2}", - "\u{00B7}", - "\u{1D520}", - "\u{0447}", - "\u{2713}", - "\u{2713}", - "\u{03C7}", - "\u{25CB}", - "\u{29C3}", - "\u{02C6}", - "\u{2257}", - "\u{21BA}", - "\u{21BB}", - "\u{00AE}", - "\u{24C8}", - "\u{229B}", - "\u{229A}", - "\u{229D}", - "\u{2257}", - "\u{2A10}", - "\u{2AEF}", - "\u{29C2}", - "\u{2663}", - "\u{2663}", - "\u{003A}", - "\u{2254}", - "\u{2254}", - "\u{002C}", - "\u{0040}", - "\u{2201}", - "\u{2218}", - "\u{2201}", - "\u{2102}", - "\u{2245}", - "\u{2A6D}", - "\u{222E}", - "\u{1D554}", - "\u{2210}", - "\u{00A9}", - "\u{2117}", - "\u{21B5}", - "\u{2717}", - "\u{1D4B8}", - "\u{2ACF}", - "\u{2AD1}", - "\u{2AD0}", - "\u{2AD2}", - "\u{22EF}", - "\u{2938}", - "\u{2935}", - "\u{22DE}", - "\u{22DF}", - "\u{21B6}", - "\u{293D}", - "\u{222A}", - "\u{2A48}", - "\u{2A46}", - "\u{2A4A}", - "\u{228D}", - "\u{2A45}", - "\u{222A}\u{FE00}", - "\u{21B7}", - "\u{293C}", - "\u{22DE}", - "\u{22DF}", - "\u{22CE}", - "\u{22CF}", - "\u{00A4}", - "\u{21B6}", - "\u{21B7}", - "\u{22CE}", - "\u{22CF}", - "\u{2232}", - "\u{2231}", - "\u{232D}", - "\u{21D3}", - "\u{2965}", - "\u{2020}", - "\u{2138}", - "\u{2193}", - "\u{2010}", - "\u{22A3}", - "\u{290F}", - "\u{02DD}", - "\u{010F}", - "\u{0434}", - "\u{2146}", - "\u{2021}", - "\u{21CA}", - "\u{2A77}", - "\u{00B0}", - "\u{03B4}", - "\u{29B1}", - "\u{297F}", - "\u{1D521}", - "\u{21C3}", - "\u{21C2}", - "\u{22C4}", - "\u{22C4}", - "\u{2666}", - "\u{2666}", - "\u{00A8}", - "\u{03DD}", - "\u{22F2}", - "\u{00F7}", - "\u{00F7}", - "\u{22C7}", - "\u{22C7}", - "\u{0452}", - "\u{231E}", - "\u{230D}", - "\u{0024}", - "\u{1D555}", - "\u{02D9}", - "\u{2250}", - "\u{2251}", - "\u{2238}", - "\u{2214}", - "\u{22A1}", - "\u{2306}", - "\u{2193}", - "\u{21CA}", - "\u{21C3}", - "\u{21C2}", - "\u{2910}", - "\u{231F}", - "\u{230C}", - "\u{1D4B9}", - "\u{0455}", - "\u{29F6}", - "\u{0111}", - "\u{22F1}", - "\u{25BF}", - "\u{25BE}", - "\u{21F5}", - "\u{296F}", - "\u{29A6}", - "\u{045F}", - "\u{27FF}", - "\u{2A77}", - "\u{2251}", - "\u{00E9}", - "\u{2A6E}", - "\u{011B}", - "\u{2256}", - "\u{00EA}", - "\u{2255}", - "\u{044D}", - "\u{0117}", - "\u{2147}", - "\u{2252}", - "\u{1D522}", - "\u{2A9A}", - "\u{00E8}", - "\u{2A96}", - "\u{2A98}", - "\u{2A99}", - "\u{23E7}", - "\u{2113}", - "\u{2A95}", - "\u{2A97}", - "\u{0113}", - "\u{2205}", - "\u{2205}", - "\u{2205}", - "\u{2003}", - "\u{2004}", - "\u{2005}", - "\u{014B}", - "\u{2002}", - "\u{0119}", - "\u{1D556}", - "\u{22D5}", - "\u{29E3}", - "\u{2A71}", - "\u{03B5}", - "\u{03B5}", - "\u{03F5}", - "\u{2256}", - "\u{2255}", - "\u{2242}", - "\u{2A96}", - "\u{2A95}", - "\u{003D}", - "\u{225F}", - "\u{2261}", - "\u{2A78}", - "\u{29E5}", - "\u{2253}", - "\u{2971}", - "\u{212F}", - "\u{2250}", - "\u{2242}", - "\u{03B7}", - "\u{00F0}", - "\u{00EB}", - "\u{20AC}", - "\u{0021}", - "\u{2203}", - "\u{2130}", - "\u{2147}", - "\u{2252}", - "\u{0444}", - "\u{2640}", - "\u{FB03}", - "\u{FB00}", - "\u{FB04}", - "\u{1D523}", - "\u{FB01}", - "\u{0066}\u{006A}", - "\u{266D}", - "\u{FB02}", - "\u{25B1}", - "\u{0192}", - "\u{1D557}", - "\u{2200}", - "\u{22D4}", - "\u{2AD9}", - "\u{2A0D}", - "\u{00BD}", - "\u{2153}", - "\u{00BC}", - "\u{2155}", - "\u{2159}", - "\u{215B}", - "\u{2154}", - "\u{2156}", - "\u{00BE}", - "\u{2157}", - "\u{215C}", - "\u{2158}", - "\u{215A}", - "\u{215D}", - "\u{215E}", - "\u{2044}", - "\u{2322}", - "\u{1D4BB}", - "\u{2267}", - "\u{2A8C}", - "\u{01F5}", - "\u{03B3}", - "\u{03DD}", - "\u{2A86}", - "\u{011F}", - "\u{011D}", - "\u{0433}", - "\u{0121}", - "\u{2265}", - "\u{22DB}", - "\u{2265}", - "\u{2267}", - "\u{2A7E}", - "\u{2A7E}", - "\u{2AA9}", - "\u{2A80}", - "\u{2A82}", - "\u{2A84}", - "\u{22DB}\u{FE00}", - "\u{2A94}", - "\u{1D524}", - "\u{226B}", - "\u{22D9}", - "\u{2137}", - "\u{0453}", - "\u{2277}", - "\u{2A92}", - "\u{2AA5}", - "\u{2AA4}", - "\u{2269}", - "\u{2A8A}", - "\u{2A8A}", - "\u{2A88}", - "\u{2A88}", - "\u{2269}", - "\u{22E7}", - "\u{1D558}", - "\u{0060}", - "\u{210A}", - "\u{2273}", - "\u{2A8E}", - "\u{2A90}", - "\u{003E}", - "\u{2AA7}", - "\u{2A7A}", - "\u{22D7}", - "\u{2995}", - "\u{2A7C}", - "\u{2A86}", - "\u{2978}", - "\u{22D7}", - "\u{22DB}", - "\u{2A8C}", - "\u{2277}", - "\u{2273}", - "\u{2269}\u{FE00}", - "\u{2269}\u{FE00}", - "\u{21D4}", - "\u{200A}", - "\u{00BD}", - "\u{210B}", - "\u{044A}", - "\u{2194}", - "\u{2948}", - "\u{21AD}", - "\u{210F}", - "\u{0125}", - "\u{2665}", - "\u{2665}", - "\u{2026}", - "\u{22B9}", - "\u{1D525}", - "\u{2925}", - "\u{2926}", - "\u{21FF}", - "\u{223B}", - "\u{21A9}", - "\u{21AA}", - "\u{1D559}", - "\u{2015}", - "\u{1D4BD}", - "\u{210F}", - "\u{0127}", - "\u{2043}", - "\u{2010}", - "\u{00ED}", - "\u{2063}", - "\u{00EE}", - "\u{0438}", - "\u{0435}", - "\u{00A1}", - "\u{21D4}", - "\u{1D526}", - "\u{00EC}", - "\u{2148}", - "\u{2A0C}", - "\u{222D}", - "\u{29DC}", - "\u{2129}", - "\u{0133}", - "\u{012B}", - "\u{2111}", - "\u{2110}", - "\u{2111}", - "\u{0131}", - "\u{22B7}", - "\u{01B5}", - "\u{2208}", - "\u{2105}", - "\u{221E}", - "\u{29DD}", - "\u{0131}", - "\u{222B}", - "\u{22BA}", - "\u{2124}", - "\u{22BA}", - "\u{2A17}", - "\u{2A3C}", - "\u{0451}", - "\u{012F}", - "\u{1D55A}", - "\u{03B9}", - "\u{2A3C}", - "\u{00BF}", - "\u{1D4BE}", - "\u{2208}", - "\u{22F9}", - "\u{22F5}", - "\u{22F4}", - "\u{22F3}", - "\u{2208}", - "\u{2062}", - "\u{0129}", - "\u{0456}", - "\u{00EF}", - "\u{0135}", - "\u{0439}", - "\u{1D527}", - "\u{0237}", - "\u{1D55B}", - "\u{1D4BF}", - "\u{0458}", - "\u{0454}", - "\u{03BA}", - "\u{03F0}", - "\u{0137}", - "\u{043A}", - "\u{1D528}", - "\u{0138}", - "\u{0445}", - "\u{045C}", - "\u{1D55C}", - "\u{1D4C0}", - "\u{21DA}", - "\u{21D0}", - "\u{291B}", - "\u{290E}", - "\u{2266}", - "\u{2A8B}", - "\u{2962}", - "\u{013A}", - "\u{29B4}", - "\u{2112}", - "\u{03BB}", - "\u{27E8}", - "\u{2991}", - "\u{27E8}", - "\u{2A85}", - "\u{00AB}", - "\u{2190}", - "\u{21E4}", - "\u{291F}", - "\u{291D}", - "\u{21A9}", - "\u{21AB}", - "\u{2939}", - "\u{2973}", - "\u{21A2}", - "\u{2AAB}", - "\u{2919}", - "\u{2AAD}", - "\u{2AAD}\u{FE00}", - "\u{290C}", - "\u{2772}", - "\u{007B}", - "\u{005B}", - "\u{298B}", - "\u{298F}", - "\u{298D}", - "\u{013E}", - "\u{013C}", - "\u{2308}", - "\u{007B}", - "\u{043B}", - "\u{2936}", - "\u{201C}", - "\u{201E}", - "\u{2967}", - "\u{294B}", - "\u{21B2}", - "\u{2264}", - "\u{2190}", - "\u{21A2}", - "\u{21BD}", - "\u{21BC}", - "\u{21C7}", - "\u{2194}", - "\u{21C6}", - "\u{21CB}", - "\u{21AD}", - "\u{22CB}", - "\u{22DA}", - "\u{2264}", - "\u{2266}", - "\u{2A7D}", - "\u{2A7D}", - "\u{2AA8}", - "\u{2A7F}", - "\u{2A81}", - "\u{2A83}", - "\u{22DA}\u{FE00}", - "\u{2A93}", - "\u{2A85}", - "\u{22D6}", - "\u{22DA}", - "\u{2A8B}", - "\u{2276}", - "\u{2272}", - "\u{297C}", - "\u{230A}", - "\u{1D529}", - "\u{2276}", - "\u{2A91}", - "\u{21BD}", - "\u{21BC}", - "\u{296A}", - "\u{2584}", - "\u{0459}", - "\u{226A}", - "\u{21C7}", - "\u{231E}", - "\u{296B}", - "\u{25FA}", - "\u{0140}", - "\u{23B0}", - "\u{23B0}", - "\u{2268}", - "\u{2A89}", - "\u{2A89}", - "\u{2A87}", - "\u{2A87}", - "\u{2268}", - "\u{22E6}", - "\u{27EC}", - "\u{21FD}", - "\u{27E6}", - "\u{27F5}", - "\u{27F7}", - "\u{27FC}", - "\u{27F6}", - "\u{21AB}", - "\u{21AC}", - "\u{2985}", - "\u{1D55D}", - "\u{2A2D}", - "\u{2A34}", - "\u{2217}", - "\u{005F}", - "\u{25CA}", - "\u{25CA}", - "\u{29EB}", - "\u{0028}", - "\u{2993}", - "\u{21C6}", - "\u{231F}", - "\u{21CB}", - "\u{296D}", - "\u{200E}", - "\u{22BF}", - "\u{2039}", - "\u{1D4C1}", - "\u{21B0}", - "\u{2272}", - "\u{2A8D}", - "\u{2A8F}", - "\u{005B}", - "\u{2018}", - "\u{201A}", - "\u{0142}", - "\u{003C}", - "\u{2AA6}", - "\u{2A79}", - "\u{22D6}", - "\u{22CB}", - "\u{22C9}", - "\u{2976}", - "\u{2A7B}", - "\u{2996}", - "\u{25C3}", - "\u{22B4}", - "\u{25C2}", - "\u{294A}", - "\u{2966}", - "\u{2268}\u{FE00}", - "\u{2268}\u{FE00}", - "\u{223A}", - "\u{00AF}", - "\u{2642}", - "\u{2720}", - "\u{2720}", - "\u{21A6}", - "\u{21A6}", - "\u{21A7}", - "\u{21A4}", - "\u{21A5}", - "\u{25AE}", - "\u{2A29}", - "\u{043C}", - "\u{2014}", - "\u{2221}", - "\u{1D52A}", - "\u{2127}", - "\u{00B5}", - "\u{2223}", - "\u{002A}", - "\u{2AF0}", - "\u{00B7}", - "\u{2212}", - "\u{229F}", - "\u{2238}", - "\u{2A2A}", - "\u{2ADB}", - "\u{2026}", - "\u{2213}", - "\u{22A7}", - "\u{1D55E}", - "\u{2213}", - "\u{1D4C2}", - "\u{223E}", - "\u{03BC}", - "\u{22B8}", - "\u{22B8}", - "\u{22D9}\u{0338}", - "\u{226B}\u{20D2}", - "\u{226B}\u{0338}", - "\u{21CD}", - "\u{21CE}", - "\u{22D8}\u{0338}", - "\u{226A}\u{20D2}", - "\u{226A}\u{0338}", - "\u{21CF}", - "\u{22AF}", - "\u{22AE}", - "\u{2207}", - "\u{0144}", - "\u{2220}\u{20D2}", - "\u{2249}", - "\u{2A70}\u{0338}", - "\u{224B}\u{0338}", - "\u{0149}", - "\u{2249}", - "\u{266E}", - "\u{266E}", - "\u{2115}", - "\u{00A0}", - "\u{224E}\u{0338}", - "\u{224F}\u{0338}", - "\u{2A43}", - "\u{0148}", - "\u{0146}", - "\u{2247}", - "\u{2A6D}\u{0338}", - "\u{2A42}", - "\u{043D}", - "\u{2013}", - "\u{2260}", - "\u{21D7}", - "\u{2924}", - "\u{2197}", - "\u{2197}", - "\u{2250}\u{0338}", - "\u{2262}", - "\u{2928}", - "\u{2242}\u{0338}", - "\u{2204}", - "\u{2204}", - "\u{1D52B}", - "\u{2267}\u{0338}", - "\u{2271}", - "\u{2271}", - "\u{2267}\u{0338}", - "\u{2A7E}\u{0338}", - "\u{2A7E}\u{0338}", - "\u{2275}", - "\u{226F}", - "\u{226F}", - "\u{21CE}", - "\u{21AE}", - "\u{2AF2}", - "\u{220B}", - "\u{22FC}", - "\u{22FA}", - "\u{220B}", - "\u{045A}", - "\u{21CD}", - "\u{2266}\u{0338}", - "\u{219A}", - "\u{2025}", - "\u{2270}", - "\u{219A}", - "\u{21AE}", - "\u{2270}", - "\u{2266}\u{0338}", - "\u{2A7D}\u{0338}", - "\u{2A7D}\u{0338}", - "\u{226E}", - "\u{2274}", - "\u{226E}", - "\u{22EA}", - "\u{22EC}", - "\u{2224}", - "\u{1D55F}", - "\u{00AC}", - "\u{2209}", - "\u{22F9}\u{0338}", - "\u{22F5}\u{0338}", - "\u{2209}", - "\u{22F7}", - "\u{22F6}", - "\u{220C}", - "\u{220C}", - "\u{22FE}", - "\u{22FD}", - "\u{2226}", - "\u{2226}", - "\u{2AFD}\u{20E5}", - "\u{2202}\u{0338}", - "\u{2A14}", - "\u{2280}", - "\u{22E0}", - "\u{2AAF}\u{0338}", - "\u{2280}", - "\u{2AAF}\u{0338}", - "\u{21CF}", - "\u{219B}", - "\u{2933}\u{0338}", - "\u{219D}\u{0338}", - "\u{219B}", - "\u{22EB}", - "\u{22ED}", - "\u{2281}", - "\u{22E1}", - "\u{2AB0}\u{0338}", - "\u{1D4C3}", - "\u{2224}", - "\u{2226}", - "\u{2241}", - "\u{2244}", - "\u{2244}", - "\u{2224}", - "\u{2226}", - "\u{22E2}", - "\u{22E3}", - "\u{2284}", - "\u{2AC5}\u{0338}", - "\u{2288}", - "\u{2282}\u{20D2}", - "\u{2288}", - "\u{2AC5}\u{0338}", - "\u{2281}", - "\u{2AB0}\u{0338}", - "\u{2285}", - "\u{2AC6}\u{0338}", - "\u{2289}", - "\u{2283}\u{20D2}", - "\u{2289}", - "\u{2AC6}\u{0338}", - "\u{2279}", - "\u{00F1}", - "\u{2278}", - "\u{22EA}", - "\u{22EC}", - "\u{22EB}", - "\u{22ED}", - "\u{03BD}", - "\u{0023}", - "\u{2116}", - "\u{2007}", - "\u{22AD}", - "\u{2904}", - "\u{224D}\u{20D2}", - "\u{22AC}", - "\u{2265}\u{20D2}", - "\u{003E}\u{20D2}", - "\u{29DE}", - "\u{2902}", - "\u{2264}\u{20D2}", - "\u{003C}\u{20D2}", - "\u{22B4}\u{20D2}", - "\u{2903}", - "\u{22B5}\u{20D2}", - "\u{223C}\u{20D2}", - "\u{21D6}", - "\u{2923}", - "\u{2196}", - "\u{2196}", - "\u{2927}", - "\u{24C8}", - "\u{00F3}", - "\u{229B}", - "\u{229A}", - "\u{00F4}", - "\u{043E}", - "\u{229D}", - "\u{0151}", - "\u{2A38}", - "\u{2299}", - "\u{29BC}", - "\u{0153}", - "\u{29BF}", - "\u{1D52C}", - "\u{02DB}", - "\u{00F2}", - "\u{29C1}", - "\u{29B5}", - "\u{03A9}", - "\u{222E}", - "\u{21BA}", - "\u{29BE}", - "\u{29BB}", - "\u{203E}", - "\u{29C0}", - "\u{014D}", - "\u{03C9}", - "\u{03BF}", - "\u{29B6}", - "\u{2296}", - "\u{1D560}", - "\u{29B7}", - "\u{29B9}", - "\u{2295}", - "\u{2228}", - "\u{21BB}", - "\u{2A5D}", - "\u{2134}", - "\u{2134}", - "\u{00AA}", - "\u{00BA}", - "\u{22B6}", - "\u{2A56}", - "\u{2A57}", - "\u{2A5B}", - "\u{2134}", - "\u{00F8}", - "\u{2298}", - "\u{00F5}", - "\u{2297}", - "\u{2A36}", - "\u{00F6}", - "\u{233D}", - "\u{2225}", - "\u{00B6}", - "\u{2225}", - "\u{2AF3}", - "\u{2AFD}", - "\u{2202}", - "\u{043F}", - "\u{0025}", - "\u{002E}", - "\u{2030}", - "\u{22A5}", - "\u{2031}", - "\u{1D52D}", - "\u{03C6}", - "\u{03D5}", - "\u{2133}", - "\u{260E}", - "\u{03C0}", - "\u{22D4}", - "\u{03D6}", - "\u{210F}", - "\u{210E}", - "\u{210F}", - "\u{002B}", - "\u{2A23}", - "\u{229E}", - "\u{2A22}", - "\u{2214}", - "\u{2A25}", - "\u{2A72}", - "\u{00B1}", - "\u{2A26}", - "\u{2A27}", - "\u{00B1}", - "\u{2A15}", - "\u{1D561}", - "\u{00A3}", - "\u{227A}", - "\u{2AB3}", - "\u{2AB7}", - "\u{227C}", - "\u{2AAF}", - "\u{227A}", - "\u{2AB7}", - "\u{227C}", - "\u{2AAF}", - "\u{2AB9}", - "\u{2AB5}", - "\u{22E8}", - "\u{227E}", - "\u{2032}", - "\u{2119}", - "\u{2AB5}", - "\u{2AB9}", - "\u{22E8}", - "\u{220F}", - "\u{232E}", - "\u{2312}", - "\u{2313}", - "\u{221D}", - "\u{221D}", - "\u{227E}", - "\u{22B0}", - "\u{1D4C5}", - "\u{03C8}", - "\u{2008}", - "\u{1D52E}", - "\u{2A0C}", - "\u{1D562}", - "\u{2057}", - "\u{1D4C6}", - "\u{210D}", - "\u{2A16}", - "\u{003F}", - "\u{225F}", - "\u{0022}", - "\u{21DB}", - "\u{21D2}", - "\u{291C}", - "\u{290F}", - "\u{2964}", - "\u{223D}\u{0331}", - "\u{0155}", - "\u{221A}", - "\u{29B3}", - "\u{27E9}", - "\u{2992}", - "\u{29A5}", - "\u{27E9}", - "\u{00BB}", - "\u{2192}", - "\u{2975}", - "\u{21E5}", - "\u{2920}", - "\u{2933}", - "\u{291E}", - "\u{21AA}", - "\u{21AC}", - "\u{2945}", - "\u{2974}", - "\u{21A3}", - "\u{219D}", - "\u{291A}", - "\u{2236}", - "\u{211A}", - "\u{290D}", - "\u{2773}", - "\u{007D}", - "\u{005D}", - "\u{298C}", - "\u{298E}", - "\u{2990}", - "\u{0159}", - "\u{0157}", - "\u{2309}", - "\u{007D}", - "\u{0440}", - "\u{2937}", - "\u{2969}", - "\u{201D}", - "\u{201D}", - "\u{21B3}", - "\u{211C}", - "\u{211B}", - "\u{211C}", - "\u{211D}", - "\u{25AD}", - "\u{00AE}", - "\u{297D}", - "\u{230B}", - "\u{1D52F}", - "\u{21C1}", - "\u{21C0}", - "\u{296C}", - "\u{03C1}", - "\u{03F1}", - "\u{2192}", - "\u{21A3}", - "\u{21C1}", - "\u{21C0}", - "\u{21C4}", - "\u{21CC}", - "\u{21C9}", - "\u{219D}", - "\u{22CC}", - "\u{02DA}", - "\u{2253}", - "\u{21C4}", - "\u{21CC}", - "\u{200F}", - "\u{23B1}", - "\u{23B1}", - "\u{2AEE}", - "\u{27ED}", - "\u{21FE}", - "\u{27E7}", - "\u{2986}", - "\u{1D563}", - "\u{2A2E}", - "\u{2A35}", - "\u{0029}", - "\u{2994}", - "\u{2A12}", - "\u{21C9}", - "\u{203A}", - "\u{1D4C7}", - "\u{21B1}", - "\u{005D}", - "\u{2019}", - "\u{2019}", - "\u{22CC}", - "\u{22CA}", - "\u{25B9}", - "\u{22B5}", - "\u{25B8}", - "\u{29CE}", - "\u{2968}", - "\u{211E}", - "\u{015B}", - "\u{201A}", - "\u{227B}", - "\u{2AB4}", - "\u{2AB8}", - "\u{0161}", - "\u{227D}", - "\u{2AB0}", - "\u{015F}", - "\u{015D}", - "\u{2AB6}", - "\u{2ABA}", - "\u{22E9}", - "\u{2A13}", - "\u{227F}", - "\u{0441}", - "\u{22C5}", - "\u{22A1}", - "\u{2A66}", - "\u{21D8}", - "\u{2925}", - "\u{2198}", - "\u{2198}", - "\u{00A7}", - "\u{003B}", - "\u{2929}", - "\u{2216}", - "\u{2216}", - "\u{2736}", - "\u{1D530}", - "\u{2322}", - "\u{266F}", - "\u{0449}", - "\u{0448}", - "\u{2223}", - "\u{2225}", - "\u{00AD}", - "\u{03C3}", - "\u{03C2}", - "\u{03C2}", - "\u{223C}", - "\u{2A6A}", - "\u{2243}", - "\u{2243}", - "\u{2A9E}", - "\u{2AA0}", - "\u{2A9D}", - "\u{2A9F}", - "\u{2246}", - "\u{2A24}", - "\u{2972}", - "\u{2190}", - "\u{2216}", - "\u{2A33}", - "\u{29E4}", - "\u{2223}", - "\u{2323}", - "\u{2AAA}", - "\u{2AAC}", - "\u{2AAC}\u{FE00}", - "\u{044C}", - "\u{002F}", - "\u{29C4}", - "\u{233F}", - "\u{1D564}", - "\u{2660}", - "\u{2660}", - "\u{2225}", - "\u{2293}", - "\u{2293}\u{FE00}", - "\u{2294}", - "\u{2294}\u{FE00}", - "\u{228F}", - "\u{2291}", - "\u{228F}", - "\u{2291}", - "\u{2290}", - "\u{2292}", - "\u{2290}", - "\u{2292}", - "\u{25A1}", - "\u{25A1}", - "\u{25AA}", - "\u{25AA}", - "\u{2192}", - "\u{1D4C8}", - "\u{2216}", - "\u{2323}", - "\u{22C6}", - "\u{2606}", - "\u{2605}", - "\u{03F5}", - "\u{03D5}", - "\u{00AF}", - "\u{2282}", - "\u{2AC5}", - "\u{2ABD}", - "\u{2286}", - "\u{2AC3}", - "\u{2AC1}", - "\u{2ACB}", - "\u{228A}", - "\u{2ABF}", - "\u{2979}", - "\u{2282}", - "\u{2286}", - "\u{2AC5}", - "\u{228A}", - "\u{2ACB}", - "\u{2AC7}", - "\u{2AD5}", - "\u{2AD3}", - "\u{227B}", - "\u{2AB8}", - "\u{227D}", - "\u{2AB0}", - "\u{2ABA}", - "\u{2AB6}", - "\u{22E9}", - "\u{227F}", - "\u{2211}", - "\u{266A}", - "\u{2283}", - "\u{00B9}", - "\u{00B2}", - "\u{00B3}", - "\u{2AC6}", - "\u{2ABE}", - "\u{2AD8}", - "\u{2287}", - "\u{2AC4}", - "\u{27C9}", - "\u{2AD7}", - "\u{297B}", - "\u{2AC2}", - "\u{2ACC}", - "\u{228B}", - "\u{2AC0}", - "\u{2283}", - "\u{2287}", - "\u{2AC6}", - "\u{228B}", - "\u{2ACC}", - "\u{2AC8}", - "\u{2AD4}", - "\u{2AD6}", - "\u{21D9}", - "\u{2926}", - "\u{2199}", - "\u{2199}", - "\u{292A}", - "\u{00DF}", - "\u{2316}", - "\u{03C4}", - "\u{23B4}", - "\u{0165}", - "\u{0163}", - "\u{0442}", - "\u{20DB}", - "\u{2315}", - "\u{1D531}", - "\u{2234}", - "\u{2234}", - "\u{03B8}", - "\u{03D1}", - "\u{03D1}", - "\u{2248}", - "\u{223C}", - "\u{2009}", - "\u{2248}", - "\u{223C}", - "\u{00FE}", - "\u{02DC}", - "\u{00D7}", - "\u{22A0}", - "\u{2A31}", - "\u{2A30}", - "\u{222D}", - "\u{2928}", - "\u{22A4}", - "\u{2336}", - "\u{2AF1}", - "\u{1D565}", - "\u{2ADA}", - "\u{2929}", - "\u{2034}", - "\u{2122}", - "\u{25B5}", - "\u{25BF}", - "\u{25C3}", - "\u{22B4}", - "\u{225C}", - "\u{25B9}", - "\u{22B5}", - "\u{25EC}", - "\u{225C}", - "\u{2A3A}", - "\u{2A39}", - "\u{29CD}", - "\u{2A3B}", - "\u{23E2}", - "\u{1D4C9}", - "\u{0446}", - "\u{045B}", - "\u{0167}", - "\u{226C}", - "\u{219E}", - "\u{21A0}", - "\u{21D1}", - "\u{2963}", - "\u{00FA}", - "\u{2191}", - "\u{045E}", - "\u{016D}", - "\u{00FB}", - "\u{0443}", - "\u{21C5}", - "\u{0171}", - "\u{296E}", - "\u{297E}", - "\u{1D532}", - "\u{00F9}", - "\u{21BF}", - "\u{21BE}", - "\u{2580}", - "\u{231C}", - "\u{231C}", - "\u{230F}", - "\u{25F8}", - "\u{016B}", - "\u{00A8}", - "\u{0173}", - "\u{1D566}", - "\u{2191}", - "\u{2195}", - "\u{21BF}", - "\u{21BE}", - "\u{228E}", - "\u{03C5}", - "\u{03D2}", - "\u{03C5}", - "\u{21C8}", - "\u{231D}", - "\u{231D}", - "\u{230E}", - "\u{016F}", - "\u{25F9}", - "\u{1D4CA}", - "\u{22F0}", - "\u{0169}", - "\u{25B5}", - "\u{25B4}", - "\u{21C8}", - "\u{00FC}", - "\u{29A7}", - "\u{21D5}", - "\u{2AE8}", - "\u{2AE9}", - "\u{22A8}", - "\u{299C}", - "\u{03F5}", - "\u{03F0}", - "\u{2205}", - "\u{03D5}", - "\u{03D6}", - "\u{221D}", - "\u{2195}", - "\u{03F1}", - "\u{03C2}", - "\u{228A}\u{FE00}", - "\u{2ACB}\u{FE00}", - "\u{228B}\u{FE00}", - "\u{2ACC}\u{FE00}", - "\u{03D1}", - "\u{22B2}", - "\u{22B3}", - "\u{0432}", - "\u{22A2}", - "\u{2228}", - "\u{22BB}", - "\u{225A}", - "\u{22EE}", - "\u{007C}", - "\u{007C}", - "\u{1D533}", - "\u{22B2}", - "\u{2282}\u{20D2}", - "\u{2283}\u{20D2}", - "\u{1D567}", - "\u{221D}", - "\u{22B3}", - "\u{1D4CB}", - "\u{2ACB}\u{FE00}", - "\u{228A}\u{FE00}", - "\u{2ACC}\u{FE00}", - "\u{228B}\u{FE00}", - "\u{299A}", - "\u{0175}", - "\u{2A5F}", - "\u{2227}", - "\u{2259}", - "\u{2118}", - "\u{1D534}", - "\u{1D568}", - "\u{2118}", - "\u{2240}", - "\u{2240}", - "\u{1D4CC}", - "\u{22C2}", - "\u{25EF}", - "\u{22C3}", - "\u{25BD}", - "\u{1D535}", - "\u{27FA}", - "\u{27F7}", - "\u{03BE}", - "\u{27F8}", - "\u{27F5}", - "\u{27FC}", - "\u{22FB}", - "\u{2A00}", - "\u{1D569}", - "\u{2A01}", - "\u{2A02}", - "\u{27F9}", - "\u{27F6}", - "\u{1D4CD}", - "\u{2A06}", - "\u{2A04}", - "\u{25B3}", - "\u{22C1}", - "\u{22C0}", - "\u{00FD}", - "\u{044F}", - "\u{0177}", - "\u{044B}", - "\u{00A5}", - "\u{1D536}", - "\u{0457}", - "\u{1D56A}", - "\u{1D4CE}", - "\u{044E}", - "\u{00FF}", - "\u{017A}", - "\u{017E}", - "\u{0437}", - "\u{017C}", - "\u{2128}", - "\u{03B6}", - "\u{1D537}", - "\u{0436}", - "\u{21DD}", - "\u{1D56B}", - "\u{1D4CF}", - "\u{200D}", - "\u{200C}", - ]; - -pub fn get_entity(name: &str) -> Option<&'static str> { - ENTITIES.binary_search(&name).ok().map(|i| ENTITY_VALUES[i]) +pub(crate) fn get_entity(bytes: &[u8]) -> Option<&'static str> { + ENTITIES + .binary_search_by_key(&bytes, |&(key, _value)| key) + .ok() + .map(|i| ENTITIES[i].1) } - diff -Nru rust-pulldown-cmark-0.2.0/src/escape.rs rust-pulldown-cmark-0.8.0/src/escape.rs --- rust-pulldown-cmark-0.2.0/src/escape.rs 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/escape.rs 2020-09-01 15:22:39.000000000 +0000 @@ -18,103 +18,339 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -//! Utility functions for HTML escaping +//! Utility functions for HTML escaping. Only useful when building your own +//! HTML renderer. +use std::fmt::{Arguments, Write as FmtWrite}; +use std::io::{self, ErrorKind, Write}; use std::str::from_utf8; +#[rustfmt::skip] static HREF_SAFE: [u8; 128] = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - ]; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, +]; -static HEX_CHARS: &'static [u8] = b"0123456789ABCDEF"; +static HEX_CHARS: &[u8] = b"0123456789ABCDEF"; +static AMP_ESCAPE: &str = "&"; +static SLASH_ESCAPE: &str = "'"; -pub fn escape_href(ob: &mut String, s: &str) { +/// This wrapper exists because we can't have both a blanket implementation +/// for all types implementing `Write` and types of the for `&mut W` where +/// `W: StrWrite`. Since we need the latter a lot, we choose to wrap +/// `Write` types. +pub struct WriteWrapper(pub W); + +/// Trait that allows writing string slices. This is basically an extension +/// of `std::io::Write` in order to include `String`. +pub trait StrWrite { + fn write_str(&mut self, s: &str) -> io::Result<()>; + + fn write_fmt(&mut self, args: Arguments) -> io::Result<()>; +} + +impl StrWrite for WriteWrapper +where + W: Write, +{ + #[inline] + fn write_str(&mut self, s: &str) -> io::Result<()> { + self.0.write_all(s.as_bytes()) + } + + #[inline] + fn write_fmt(&mut self, args: Arguments) -> io::Result<()> { + self.0.write_fmt(args) + } +} + +impl<'w> StrWrite for String { + #[inline] + fn write_str(&mut self, s: &str) -> io::Result<()> { + self.push_str(s); + Ok(()) + } + + #[inline] + fn write_fmt(&mut self, args: Arguments) -> io::Result<()> { + // FIXME: translate fmt error to io error? + FmtWrite::write_fmt(self, args).map_err(|_| ErrorKind::Other.into()) + } +} + +impl StrWrite for &'_ mut W +where + W: StrWrite, +{ + #[inline] + fn write_str(&mut self, s: &str) -> io::Result<()> { + (**self).write_str(s) + } + + #[inline] + fn write_fmt(&mut self, args: Arguments) -> io::Result<()> { + (**self).write_fmt(args) + } +} + +/// Writes an href to the buffer, escaping href unsafe bytes. +pub fn escape_href(mut w: W, s: &str) -> io::Result<()> +where + W: StrWrite, +{ + let bytes = s.as_bytes(); let mut mark = 0; - for i in 0..s.len() { - let c = s.as_bytes()[i]; + for i in 0..bytes.len() { + let c = bytes[i]; if c >= 0x80 || HREF_SAFE[c as usize] == 0 { // character needing escape // write partial substring up to mark if mark < i { - ob.push_str(&s[mark..i]); + w.write_str(&s[mark..i])?; } match c { b'&' => { - ob.push_str("&"); - }, + w.write_str(AMP_ESCAPE)?; + } b'\'' => { - ob.push_str("'"); - }, + w.write_str(SLASH_ESCAPE)?; + } _ => { let mut buf = [0u8; 3]; buf[0] = b'%'; buf[1] = HEX_CHARS[((c as usize) >> 4) & 0xF]; buf[2] = HEX_CHARS[(c as usize) & 0xF]; - ob.push_str(from_utf8(&buf).unwrap()); + let escaped = from_utf8(&buf).unwrap(); + w.write_str(escaped)?; } } - mark = i + 1; // all escaped characters are ASCII + mark = i + 1; // all escaped characters are ASCII } } - ob.push_str(&s[mark..]); + w.write_str(&s[mark..]) } -static HTML_ESCAPE_TABLE: [u8; 256] = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ]; - -static HTML_ESCAPES: [&'static str; 6] = [ - "", - """, - "&", - "/", - "<", - ">" - ]; +const fn create_html_escape_table() -> [u8; 256] { + let mut table = [0; 256]; + table[b'"' as usize] = 1; + table[b'&' as usize] = 2; + table[b'<' as usize] = 3; + table[b'>' as usize] = 4; + table +} -pub fn escape_html(ob: &mut String, s: &str, secure: bool) { - let size = s.len(); +static HTML_ESCAPE_TABLE: [u8; 256] = create_html_escape_table(); + +static HTML_ESCAPES: [&'static str; 5] = ["", """, "&", "<", ">"]; + +/// Writes the given string to the Write sink, replacing special HTML bytes +/// (<, >, &, ") by escape sequences. +pub fn escape_html(w: W, s: &str) -> io::Result<()> { + #[cfg(all(target_arch = "x86_64", feature = "simd"))] + { + simd::escape_html(w, s) + } + #[cfg(not(all(target_arch = "x86_64", feature = "simd")))] + { + escape_html_scalar(w, s) + } +} + +fn escape_html_scalar(mut w: W, s: &str) -> io::Result<()> { let bytes = s.as_bytes(); let mut mark = 0; let mut i = 0; - while i < size { - match bytes[i..].iter().position(|&c| HTML_ESCAPE_TABLE[c as usize] != 0) { + while i < s.len() { + match bytes[i..] + .iter() + .position(|&c| HTML_ESCAPE_TABLE[c as usize] != 0) + { Some(pos) => { i += pos; } - None => break + None => break, } let c = bytes[i]; let escape = HTML_ESCAPE_TABLE[c as usize]; - if escape != 0 && (secure || c != b'/') { - ob.push_str(&s[mark..i]); - ob.push_str(HTML_ESCAPES[escape as usize]); - mark = i + 1; // all escaped characters are ASCII - } + let escape_seq = HTML_ESCAPES[escape as usize]; + w.write_str(&s[mark..i])?; + w.write_str(escape_seq)?; i += 1; + mark = i; // all escaped characters are ASCII + } + w.write_str(&s[mark..]) +} + +#[cfg(all(target_arch = "x86_64", feature = "simd"))] +mod simd { + use super::StrWrite; + use std::arch::x86_64::*; + use std::io; + use std::mem::size_of; + + const VECTOR_SIZE: usize = size_of::<__m128i>(); + + pub(crate) fn escape_html(mut w: W, s: &str) -> io::Result<()> { + // The SIMD accelerated code uses the PSHUFB instruction, which is part + // of the SSSE3 instruction set. Further, we can only use this code if + // the buffer is at least one VECTOR_SIZE in length to prevent reading + // out of bounds. If either of these conditions is not met, we fall back + // to scalar code. + if is_x86_feature_detected!("ssse3") && s.len() >= VECTOR_SIZE { + let bytes = s.as_bytes(); + let mut mark = 0; + + unsafe { + foreach_special_simd(bytes, 0, |i| { + let escape_ix = *bytes.get_unchecked(i) as usize; + let replacement = + super::HTML_ESCAPES[super::HTML_ESCAPE_TABLE[escape_ix] as usize]; + w.write_str(&s.get_unchecked(mark..i))?; + mark = i + 1; // all escaped characters are ASCII + w.write_str(replacement) + })?; + w.write_str(&s.get_unchecked(mark..)) + } + } else { + super::escape_html_scalar(w, s) + } + } + + /// Creates the lookup table for use in `compute_mask`. + const fn create_lookup() -> [u8; 16] { + let mut table = [0; 16]; + table[(b'<' & 0x0f) as usize] = b'<'; + table[(b'>' & 0x0f) as usize] = b'>'; + table[(b'&' & 0x0f) as usize] = b'&'; + table[(b'"' & 0x0f) as usize] = b'"'; + table[0] = 0b0111_1111; + table + } + + #[target_feature(enable = "ssse3")] + /// Computes a byte mask at given offset in the byte buffer. Its first 16 (least significant) + /// bits correspond to whether there is an HTML special byte (&, <, ", >) at the 16 bytes + /// `bytes[offset..]`. For example, the mask `(1 << 3)` states that there is an HTML byte + /// at `offset + 3`. It is only safe to call this function when + /// `bytes.len() >= offset + VECTOR_SIZE`. + unsafe fn compute_mask(bytes: &[u8], offset: usize) -> i32 { + debug_assert!(bytes.len() >= offset + VECTOR_SIZE); + + let table = create_lookup(); + let lookup = _mm_loadu_si128(table.as_ptr() as *const __m128i); + let raw_ptr = bytes.as_ptr().offset(offset as isize) as *const __m128i; + + // Load the vector from memory. + let vector = _mm_loadu_si128(raw_ptr); + // We take the least significant 4 bits of every byte and use them as indices + // to map into the lookup vector. + // Note that shuffle maps bytes with their most significant bit set to lookup[0]. + // Bytes that share their lower nibble with an HTML special byte get mapped to that + // corresponding special byte. Note that all HTML special bytes have distinct lower + // nibbles. Other bytes either get mapped to 0 or 127. + let expected = _mm_shuffle_epi8(lookup, vector); + // We compare the original vector to the mapped output. Bytes that shared a lower + // nibble with an HTML special byte match *only* if they are that special byte. Bytes + // that have either a 0 lower nibble or their most significant bit set were mapped to + // 127 and will hence never match. All other bytes have non-zero lower nibbles but + // were mapped to 0 and will therefore also not match. + let matches = _mm_cmpeq_epi8(expected, vector); + + // Translate matches to a bitmask, where every 1 corresponds to a HTML special character + // and a 0 is a non-HTML byte. + _mm_movemask_epi8(matches) + } + + /// Calls the given function with the index of every byte in the given byteslice + /// that is either ", &, <, or > and for no other byte. + /// Make sure to only call this when `bytes.len() >= 16`, undefined behaviour may + /// occur otherwise. + #[target_feature(enable = "ssse3")] + unsafe fn foreach_special_simd( + bytes: &[u8], + mut offset: usize, + mut callback: F, + ) -> io::Result<()> + where + F: FnMut(usize) -> io::Result<()>, + { + // The strategy here is to walk the byte buffer in chunks of VECTOR_SIZE (16) + // bytes at a time starting at the given offset. For each chunk, we compute a + // a bitmask indicating whether the corresponding byte is a HTML special byte. + // We then iterate over all the 1 bits in this mask and call the callback function + // with the corresponding index in the buffer. + // When the number of HTML special bytes in the buffer is relatively low, this + // allows us to quickly go through the buffer without a lookup and for every + // single byte. + + debug_assert!(bytes.len() >= VECTOR_SIZE); + let upperbound = bytes.len() - VECTOR_SIZE; + while offset < upperbound { + let mut mask = compute_mask(bytes, offset); + while mask != 0 { + let ix = mask.trailing_zeros(); + callback(offset + ix as usize)?; + mask ^= mask & -mask; + } + offset += VECTOR_SIZE; + } + + // Final iteration. We align the read with the end of the slice and + // shift off the bytes at start we have already scanned. + let mut mask = compute_mask(bytes, upperbound); + mask >>= offset - upperbound; + while mask != 0 { + let ix = mask.trailing_zeros(); + callback(offset + ix as usize)?; + mask ^= mask & -mask; + } + Ok(()) + } + + #[cfg(test)] + mod html_scan_tests { + #[test] + fn multichunk() { + let mut vec = Vec::new(); + unsafe { + super::foreach_special_simd("&aXaaaa.a'aa9a<>aab&".as_bytes(), 0, |ix| { + Ok(vec.push(ix)) + }) + .unwrap(); + } + assert_eq!(vec, vec![0, 14, 15, 19]); + } + + // only match these bytes, and when we match them, match them VECTOR_SIZE times + #[test] + fn only_right_bytes_matched() { + for b in 0..255u8 { + let right_byte = b == b'&' || b == b'<' || b == b'>' || b == b'"'; + let vek = vec![b; super::VECTOR_SIZE]; + let mut match_count = 0; + unsafe { + super::foreach_special_simd(&vek, 0, |_| { + match_count += 1; + Ok(()) + }) + .unwrap(); + } + assert!((match_count > 0) == (match_count == super::VECTOR_SIZE)); + assert_eq!( + (match_count == super::VECTOR_SIZE), + right_byte, + "match_count: {}, byte: {:?}", + match_count, + b as char + ); + } + } } - ob.push_str(&s[mark..]); } diff -Nru rust-pulldown-cmark-0.2.0/src/html.rs rust-pulldown-cmark-0.8.0/src/html.rs --- rust-pulldown-cmark-0.2.0/src/html.rs 2018-11-07 16:19:31.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/html.rs 2020-09-01 15:22:39.000000000 +0000 @@ -20,228 +20,368 @@ //! HTML renderer that takes an iterator of events as input. -use std::borrow::Cow; use std::collections::HashMap; -use std::fmt::Write; +use std::io::{self, Write}; -use parse::{Event, Tag}; -use parse::Event::{Start, End, Text, Html, InlineHtml, SoftBreak, HardBreak, FootnoteReference}; -use parse::Alignment; -use escape::{escape_html, escape_href}; +use crate::escape::{escape_href, escape_html, StrWrite, WriteWrapper}; +use crate::parse::Event::*; +use crate::parse::{Alignment, CodeBlockKind, Event, LinkType, Tag}; +use crate::strings::CowStr; enum TableState { Head, Body, } -struct Ctx<'b, I> { +struct HtmlWriter<'a, I, W> { + /// Iterator supplying events. iter: I, - buf: &'b mut String, + + /// Writer to write to. + writer: W, + + /// Whether or not the last write wrote a newline. + end_newline: bool, + table_state: TableState, table_alignments: Vec, table_cell_index: usize, + numbers: HashMap, usize>, } -impl<'a, 'b, I: Iterator>> Ctx<'b, I> { - fn fresh_line(&mut self) { - if !(self.buf.is_empty() || self.buf.ends_with('\n')) { - self.buf.push('\n'); +impl<'a, I, W> HtmlWriter<'a, I, W> +where + I: Iterator>, + W: StrWrite, +{ + fn new(iter: I, writer: W) -> Self { + Self { + iter, + writer, + end_newline: true, + table_state: TableState::Head, + table_alignments: vec![], + table_cell_index: 0, + numbers: HashMap::new(), } } - pub fn run(&mut self) { - let mut numbers = HashMap::new(); + /// Writes a new line. + fn write_newline(&mut self) -> io::Result<()> { + self.end_newline = true; + self.writer.write_str("\n") + } + + /// Writes a buffer, and tracks whether or not a newline was written. + #[inline] + fn write(&mut self, s: &str) -> io::Result<()> { + self.writer.write_str(s)?; + + if !s.is_empty() { + self.end_newline = s.ends_with('\n'); + } + Ok(()) + } + + pub fn run(mut self) -> io::Result<()> { while let Some(event) = self.iter.next() { match event { - Start(tag) => self.start_tag(tag, &mut numbers), - End(tag) => self.end_tag(tag), - Text(text) => escape_html(self.buf, &text, false), - Html(html) | - InlineHtml(html) => self.buf.push_str(&html), - SoftBreak => self.buf.push('\n'), - HardBreak => self.buf.push_str("
\n"), + Start(tag) => { + self.start_tag(tag)?; + } + End(tag) => { + self.end_tag(tag)?; + } + Text(text) => { + escape_html(&mut self.writer, &text)?; + self.end_newline = text.ends_with('\n'); + } + Code(text) => { + self.write("")?; + escape_html(&mut self.writer, &text)?; + self.write("")?; + } + Html(html) => { + self.write(&html)?; + } + SoftBreak => { + self.write_newline()?; + } + HardBreak => { + self.write("
\n")?; + } + Rule => { + if self.end_newline { + self.write("
\n")?; + } else { + self.write("\n
\n")?; + } + } FootnoteReference(name) => { - let len = numbers.len() + 1; - self.buf.push_str(""); - let number = numbers.entry(name).or_insert(len); - self.buf.push_str(&*format!("{}", number)); - self.buf.push_str(""); - }, + let len = self.numbers.len() + 1; + self.write("")?; + let number = *self.numbers.entry(name).or_insert(len); + write!(&mut self.writer, "{}", number)?; + self.write("")?; + } + TaskListMarker(true) => { + self.write("\n")?; + } + TaskListMarker(false) => { + self.write("\n")?; + } } } + Ok(()) } - fn start_tag(&mut self, tag: Tag<'a>, numbers: &mut HashMap, usize>) { + /// Writes the start of an HTML tag. + fn start_tag(&mut self, tag: Tag<'a>) -> io::Result<()> { match tag { - Tag::Paragraph => { - self.fresh_line(); - self.buf.push_str("

"); - } - Tag::Rule => { - self.fresh_line(); - self.buf.push_str("


\n") - } - Tag::Header(level) => { - self.fresh_line(); - self.buf.push_str("'); + Tag::Paragraph => { + if self.end_newline { + self.write("

") + } else { + self.write("\n

") + } + } + Tag::Heading(level) => { + if self.end_newline { + self.end_newline = false; + write!(&mut self.writer, "", level) + } else { + write!(&mut self.writer, "\n", level) + } } Tag::Table(alignments) => { self.table_alignments = alignments; - self.buf.push_str(""); + self.write("
") } Tag::TableHead => { self.table_state = TableState::Head; - self.buf.push_str(""); + self.table_cell_index = 0; + self.write("") } Tag::TableRow => { self.table_cell_index = 0; - self.buf.push_str(""); + self.write("") } Tag::TableCell => { match self.table_state { - TableState::Head => self.buf.push_str(" self.buf.push_str(" { + self.write(" { + self.write(" self.buf.push_str(" align=\"left\""), - Some(&Alignment::Center) => self.buf.push_str(" align=\"center\""), - Some(&Alignment::Right) => self.buf.push_str(" align=\"right\""), - _ => (), + Some(&Alignment::Left) => self.write(" align=\"left\">"), + Some(&Alignment::Center) => self.write(" align=\"center\">"), + Some(&Alignment::Right) => self.write(" align=\"right\">"), + _ => self.write(">"), } - self.buf.push_str(">"); } Tag::BlockQuote => { - self.fresh_line(); - self.buf.push_str("
\n"); + if self.end_newline { + self.write("
\n") + } else { + self.write("\n
\n") + } } Tag::CodeBlock(info) => { - self.fresh_line(); - let lang = info.split(' ').next().unwrap(); - if lang.is_empty() { - self.buf.push_str("
");
-                } else {
-                    self.buf.push_str("
");
+                if !self.end_newline {
+                    self.write_newline()?;
+                }
+                match info {
+                    CodeBlockKind::Fenced(info) => {
+                        let lang = info.split(' ').next().unwrap();
+                        if lang.is_empty() {
+                            self.write("
")
+                        } else {
+                            self.write("
")
+                        }
+                    }
+                    CodeBlockKind::Indented => self.write("
"),
                 }
             }
             Tag::List(Some(1)) => {
-                self.fresh_line();
-                self.buf.push_str("
    \n"); + if self.end_newline { + self.write("
      \n") + } else { + self.write("\n
        \n") + } } Tag::List(Some(start)) => { - self.fresh_line(); - let _ = writeln!(self.buf, "
          ", start); + if self.end_newline { + self.write("
            \n") } Tag::List(None) => { - self.fresh_line(); - self.buf.push_str("
\n"); + self.write("\n")?; } Tag::TableHead => { - self.buf.push_str("\n"); + self.write("\n")?; self.table_state = TableState::Body; } Tag::TableRow => { - self.buf.push_str("\n"); + self.write("\n")?; } Tag::TableCell => { match self.table_state { - TableState::Head => self.buf.push_str(""), - TableState::Body => self.buf.push_str(""), + TableState::Head => { + self.write("")?; + } + TableState::Body => { + self.write("")?; + } } self.table_cell_index += 1; } - Tag::BlockQuote => self.buf.push_str("\n"), - Tag::CodeBlock(_) => self.buf.push_str("\n"), - Tag::List(Some(_)) => self.buf.push_str("\n"), - Tag::List(None) => self.buf.push_str("\n"), - Tag::Item => self.buf.push_str("\n"), - Tag::Emphasis => self.buf.push_str(""), - Tag::Strong => self.buf.push_str(""), - Tag::Code => self.buf.push_str(""), - Tag::Link(_, _) => self.buf.push_str(""), - Tag::Image(_, _) => (), // shouldn't happen, handled in start - Tag::FootnoteDefinition(_) => self.buf.push_str("\n"), + Tag::BlockQuote => { + self.write("\n")?; + } + Tag::CodeBlock(_) => { + self.write("\n")?; + } + Tag::List(Some(_)) => { + self.write("\n")?; + } + Tag::List(None) => { + self.write("\n")?; + } + Tag::Item => { + self.write("\n")?; + } + Tag::Emphasis => { + self.write("")?; + } + Tag::Strong => { + self.write("")?; + } + Tag::Strikethrough => { + self.write("")?; + } + Tag::Link(_, _, _) => { + self.write("")?; + } + Tag::Image(_, _, _) => (), // shouldn't happen, handled in start + Tag::FootnoteDefinition(_) => { + self.write("\n")?; + } } + Ok(()) } // run raw text, consuming end tag - fn raw_text<'c>(&mut self, numbers: &'c mut HashMap, usize>) { + fn raw_text(&mut self) -> io::Result<()> { let mut nest = 0; while let Some(event) = self.iter.next() { match event { Start(_) => nest += 1, End(_) => { - if nest == 0 { break; } + if nest == 0 { + break; + } nest -= 1; } - Text(text) => escape_html(self.buf, &text, false), - Html(_) => (), - InlineHtml(html) => escape_html(self.buf, &html, false), - SoftBreak | HardBreak => self.buf.push(' '), + Html(text) | Code(text) | Text(text) => { + escape_html(&mut self.writer, &text)?; + self.end_newline = text.ends_with('\n'); + } + SoftBreak | HardBreak | Rule => { + self.write(" ")?; + } FootnoteReference(name) => { - let len = numbers.len() + 1; - let number = numbers.entry(name).or_insert(len); - self.buf.push_str(&*format!("[{}]", number)); + let len = self.numbers.len() + 1; + let number = *self.numbers.entry(name).or_insert(len); + write!(&mut self.writer, "[{}]", number)?; } + TaskListMarker(true) => self.write("[x]")?, + TaskListMarker(false) => self.write("[ ]")?, } } + Ok(()) } } @@ -272,13 +412,50 @@ /// /// "#); /// ``` -pub fn push_html<'a, I: Iterator>>(buf: &mut String, iter: I) { - let mut ctx = Ctx { - iter: iter, - buf: buf, - table_state: TableState::Head, - table_alignments: vec![], - table_cell_index: 0, - }; - ctx.run(); +pub fn push_html<'a, I>(s: &mut String, iter: I) +where + I: Iterator>, +{ + HtmlWriter::new(iter, s).run().unwrap(); +} + +/// Iterate over an `Iterator` of `Event`s, generate HTML for each `Event`, and +/// write it out to a writable stream. +/// +/// **Note**: using this function with an unbuffered writer like a file or socket +/// will result in poor performance. Wrap these in a +/// [`BufWriter`](https://doc.rust-lang.org/std/io/struct.BufWriter.html) to +/// prevent unnecessary slowdowns. +/// +/// # Examples +/// +/// ``` +/// use pulldown_cmark::{html, Parser}; +/// use std::io::Cursor; +/// +/// let markdown_str = r#" +/// hello +/// ===== +/// +/// * alpha +/// * beta +/// "#; +/// let mut bytes = Vec::new(); +/// let parser = Parser::new(markdown_str); +/// +/// html::write_html(Cursor::new(&mut bytes), parser); +/// +/// assert_eq!(&String::from_utf8_lossy(&bytes)[..], r#"

hello

+///
    +///
  • alpha
  • +///
  • beta
  • +///
+/// "#); +/// ``` +pub fn write_html<'a, I, W>(writer: W, iter: I) -> io::Result<()> +where + I: Iterator>, + W: Write, +{ + HtmlWriter::new(iter, WriteWrapper(writer)).run() } diff -Nru rust-pulldown-cmark-0.2.0/src/lib.rs rust-pulldown-cmark-0.8.0/src/lib.rs --- rust-pulldown-cmark-0.2.0/src/lib.rs 2018-11-07 16:19:29.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/lib.rs 2020-09-01 15:22:39.000000000 +0000 @@ -18,7 +18,34 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -//! Pull parser for commonmark. +//! Pull parser for [CommonMark](https://commonmark.org). This crate provides a [Parser](struct.Parser.html) struct +//! which is an iterator over [Event](enum.Event.html)s. This iterator can be used +//! directly, or to output HTML using the [HTML module](html/index.html). +//! +//! By default, only CommonMark features are enabled. To use extensions like tables, +//! footnotes or task lists, enable them by setting the corresponding flags in the +//! [Options](struct.Options.html) struct. +//! +//! # Example +//! ```rust +//! use pulldown_cmark::{Parser, Options, html}; +//! +//! let markdown_input = "Hello world, this is a ~~complicated~~ *very simple* example."; +//! +//! // Set up options and parser. Strikethroughs are not part of the CommonMark standard +//! // and we therefore must enable it explicitly. +//! let mut options = Options::empty(); +//! options.insert(Options::ENABLE_STRIKETHROUGH); +//! let parser = Parser::new_ext(markdown_input, options); +//! +//! // Write to String buffer. +//! let mut html_output = String::new(); +//! html::push_html(&mut html_output, parser); +//! +//! // Check that the output is what we expected. +//! let expected_html = "

Hello world, this is a complicated very simple example.

\n"; +//! assert_eq!(expected_html, &html_output); +//! ``` // When compiled for the rustc compiler itself we want to make sure that this is // an unstable crate. @@ -29,14 +56,21 @@ #[macro_use] extern crate bitflags; +extern crate unicase; -mod passes; -mod parse; -mod scanners; mod entities; -mod escape; +pub mod escape; +mod linklabel; +mod parse; mod puncttable; -mod utils; +mod scanners; +mod strings; +mod tree; + +#[cfg(all(target_arch = "x86_64", feature = "simd"))] +mod simd; -pub use passes::Parser; -pub use parse::{Alignment, Event, Tag, Options}; +pub use crate::parse::{ + Alignment, BrokenLink, CodeBlockKind, Event, LinkType, OffsetIter, Options, Parser, Tag, +}; +pub use crate::strings::{CowStr, InlineStr}; diff -Nru rust-pulldown-cmark-0.2.0/src/linklabel.rs rust-pulldown-cmark-0.8.0/src/linklabel.rs --- rust-pulldown-cmark-0.2.0/src/linklabel.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/linklabel.rs 2020-08-21 13:57:35.000000000 +0000 @@ -0,0 +1,135 @@ +// Copyright 2018 Google LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +//! Link label parsing and matching. + +use unicase::UniCase; + +use crate::scanners::{is_ascii_whitespace, scan_eol}; +use crate::strings::CowStr; + +pub enum ReferenceLabel<'a> { + Link(CowStr<'a>), + Footnote(CowStr<'a>), +} + +pub type LinkLabel<'a> = UniCase>; + +/// Assumes the opening bracket has already been scanned. +/// The line break handler determines what happens when a linebreak +/// is found. It is passed the bytes following the line break and +/// either returns `Some(k)`, where `k` is the number of bytes to skip, +/// or `None` to abort parsing the label. +/// Returns the number of bytes read (including closing bracket) and label on success. +pub(crate) fn scan_link_label_rest<'t>( + text: &'t str, + linebreak_handler: &dyn Fn(&[u8]) -> Option, +) -> Option<(usize, CowStr<'t>)> { + let bytes = text.as_bytes(); + let mut ix = 0; + let mut only_white_space = true; + let mut codepoints = 0; + // no worries, doesnt allocate until we push things onto it + let mut label = String::new(); + let mut mark = 0; + + loop { + if codepoints >= 1000 { + return None; + } + match *bytes.get(ix)? { + b'[' => return None, + b']' => break, + b'\\' => { + ix += 2; + codepoints += 2; + only_white_space = false; + } + b if is_ascii_whitespace(b) => { + // normalize labels by collapsing whitespaces, including linebreaks + let mut whitespaces = 0; + let mut linebreaks = 0; + let whitespace_start = ix; + + while ix < bytes.len() && is_ascii_whitespace(bytes[ix]) { + if let Some(eol_bytes) = scan_eol(&bytes[ix..]) { + linebreaks += 1; + if linebreaks > 1 { + return None; + } + ix += eol_bytes; + ix += linebreak_handler(&bytes[ix..])?; + whitespaces += 2; // indicate that we need to replace + } else { + whitespaces += if bytes[ix] == b' ' { 1 } else { 2 }; + ix += 1; + } + } + if whitespaces > 1 { + label.push_str(&text[mark..whitespace_start]); + label.push(' '); + mark = ix; + codepoints += ix - whitespace_start; + } else { + codepoints += 1; + } + } + b => { + only_white_space = false; + ix += 1; + if b & 0b1000_0000 != 0 { + codepoints += 1; + } + } + } + } + + if only_white_space { + None + } else { + let cow = if mark == 0 { + text[..ix].into() + } else { + label.push_str(&text[mark..ix]); + label.into() + }; + Some((ix + 1, cow)) + } +} + +#[cfg(test)] +mod test { + use super::scan_link_label_rest; + + #[test] + fn whitespace_normalization() { + let input = "«\t\tBlurry Eyes\t\t»][blurry_eyes]"; + let expected_output = "« Blurry Eyes »"; // regular spaces! + + let (_bytes, normalized_label) = scan_link_label_rest(input, &|_| None).unwrap(); + assert_eq!(expected_output, normalized_label.as_ref()); + } + + #[test] + fn return_carriage_linefeed_ok() { + let input = "hello\r\nworld\r\n]"; + assert!(scan_link_label_rest(input, &|_| Some(0)).is_some()); + } +} diff -Nru rust-pulldown-cmark-0.2.0/src/main.rs rust-pulldown-cmark-0.8.0/src/main.rs --- rust-pulldown-cmark-0.2.0/src/main.rs 2018-11-07 16:19:31.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/main.rs 2020-08-21 13:57:35.000000000 +0000 @@ -20,185 +20,34 @@ //! Command line tool to exercise pulldown-cmark. -extern crate getopts; - -extern crate pulldown_cmark; - -use pulldown_cmark::Parser; -use pulldown_cmark::Options; -use pulldown_cmark::html; +use pulldown_cmark::{html, Options, Parser}; use std::env; -use std::io; -use std::io::{Read, Write}; -use std::path::Path; -use std::fs::File; - -fn render_html(text: &str, opts: Options) -> String { - let mut s = String::with_capacity(text.len() * 3 / 2); - let p = Parser::new_ext(text, opts); - html::push_html(&mut s, p); - s -} +use std::io::{self, Read}; +use std::mem; -fn dry_run(text:&str, opts: Options) { +fn dry_run(text: &str, opts: Options) { let p = Parser::new_ext(text, opts); - /* - let events = p.collect::>(); - let count = events.len(); - */ let count = p.count(); println!("{} events", count); } fn print_events(text: &str, opts: Options) { - let mut p = Parser::new_ext(text, opts); - loop { - print!("{}: ", p.get_offset()); - if let Some(event) = p.next() { - println!("{:?}", event); - } else { - break; - } + let parser = Parser::new_ext(text, opts).into_offset_iter(); + for (event, range) in parser { + println!("{:?}: {:?}", range, event); } println!("EOF"); } -fn read_file(filename: &str) -> String { - let path = Path::new(filename); - let mut file = match File::open(&path) { - Err(why) => panic!("couldn't open {}: {}", path.display(), why), - Ok(file) => file - }; - let mut s = String::new(); - match file.read_to_string(&mut s) { - Err(why) => panic!("couldn't open {}: {}", path.display(), why), - Ok(_) => s - } -} - -// Tests in the spec (v0.26) are of the form: -// -// ```````````````````````````````` example -// -// . -// -// ```````````````````````````````` -struct Spec<'a> { - spec: &'a str, - test_n: usize, -} - -impl<'a> Spec<'a> { - pub fn new(spec: &'a str) -> Self { - Spec{ spec: spec, test_n: 0 } - } -} - -struct TestCase<'a> { - n: usize, - input: &'a str, - expected: &'a str, -} - -impl<'a> TestCase<'a> { - pub fn new(n: usize, input: &'a str, expected: &'a str) -> Self { - TestCase { n: n, input: input, expected: expected } - } +fn brief(program: &str) -> String { + format!( + "Usage: {} [options]\n\n{}", + program, "Reads markdown from standard input and emits HTML.", + ) } -impl<'a> Iterator for Spec<'a> { - type Item = TestCase<'a>; - - fn next(&mut self) -> Option> { - let spec = self.spec; - - let i_start = match self.spec.find("```````````````````````````````` example\n").map(|pos| pos + 41) { - Some(pos) => pos, - None => return None, - }; - - let i_end = match self.spec[i_start..].find("\n.\n").map(|pos| (pos + 1) + i_start){ - Some(pos) => pos, - None => return None, - }; - - let e_end = match self.spec[i_end + 2..].find("````````````````````````````````\n").map(|pos| pos + i_end + 2){ - Some(pos) => pos, - None => return None, - }; - - self.test_n += 1; - self.spec = &self.spec[e_end + 33 ..]; - - Some(TestCase::new(self.test_n, &spec[i_start .. i_end], &spec[i_end + 2 .. e_end])) - } -} - - -fn run_spec(spec_text: &str, args: &[String], opts: Options) { - //println!("spec length={}, args={:?}", spec_text.len(), args); - let (first, last) = if args.is_empty() { - (None, None) - } else { - let mut iter = args[0].split(".."); - let first = iter.next().and_then(|s| s.parse().ok()); - let last = match iter.next() { - Some(s) => s.parse().ok(), - None => first - }; - (first, last) - }; - - let spec = Spec::new(spec_text); - let mut tests_failed = 0; - let mut tests_run = 0; - let mut fail_report = String::new(); - - for test in spec { - if first.map(|fst| test.n < fst).unwrap_or(false) { continue } - if last.map(|lst| test.n > lst).unwrap_or(false) { break } - - if test.n % 10 == 1 { - if test.n % 40 == 1 { - if test.n > 1 { - println!(); - } - } else { - print!(" "); - } - print!("[{:3}]", test.n); - } else if test.n % 10 == 6 { - print!(" "); - } - - let our_html = render_html(&test.input, opts); - - if our_html == test.expected { - print!("."); - } else { - if tests_failed == 0 { - fail_report = format!("\nFAIL {}:\n\n---input---\n{:?}\n\n---wanted---\n{:?}\n\n---got---\n{:?}\n", - test.n, test.input, test.expected, our_html); - } - print!("X"); - tests_failed += 1; - } - - let _ = io::stdout().flush(); - tests_run += 1; - } - - println!("\n{}/{} tests passed", tests_run - tests_failed, tests_run); - print!("{}", fail_report); -} - -fn brief(program: ProgramName) -> String - where ProgramName: std::fmt::Display { - return format!("Usage: {} FILE [options]", program); -} - -pub fn main() { +pub fn main() -> std::io::Result<()> { let args: Vec<_> = env::args().collect(); let mut opts = getopts::Options::new(); opts.optflag("h", "help", "this help message"); @@ -206,27 +55,23 @@ opts.optflag("e", "events", "print event sequence instead of rendering"); opts.optflag("T", "enable-tables", "enable GitHub-style tables"); opts.optflag("F", "enable-footnotes", "enable Hoedown-style footnotes"); - opts.optopt("s", "spec", "run tests from spec file", "FILE"); - opts.optopt("b", "bench", "run benchmark", "FILE"); + opts.optflag( + "S", + "enable-strikethrough", + "enable GitHub-style strikethrough", + ); + opts.optflag("L", "enable-tasklists", "enable GitHub-style task lists"); + let matches = match opts.parse(&args[1..]) { Ok(m) => m, Err(f) => { - let message = format!("{}\n{}\n", - f.to_string(), - opts.usage(&brief(&args[0]))); - if let Err(err) = write!(std::io::stderr(), "{}", message) { - panic!("Failed to write to standard error: {}\n\ - Error encountered while trying to log the \ - following message: \"{}\"", - err, - message); - } + eprintln!("{}\n{}", f, opts.usage(&brief(&args[0]))); std::process::exit(1); } }; if matches.opt_present("help") { println!("{}", opts.usage(&brief(&args[0]))); - return; + return Ok(()); } let mut opts = Options::empty(); if matches.opt_present("enable-tables") { @@ -235,24 +80,30 @@ if matches.opt_present("enable-footnotes") { opts.insert(Options::ENABLE_FOOTNOTES); } - if let Some(filename) = matches.opt_str("spec") { - run_spec(&read_file(&filename).replace("→", "\t"), &matches.free, opts); - } else if let Some(filename) = matches.opt_str("bench") { - let inp = read_file(&filename); - for _ in 0..1000 { - let _ = render_html(&inp, opts); - } + if matches.opt_present("enable-strikethrough") { + opts.insert(Options::ENABLE_STRIKETHROUGH); + } + if matches.opt_present("enable-tasklists") { + opts.insert(Options::ENABLE_TASKLISTS); + } + + let mut input = String::new(); + io::stdin().lock().read_to_string(&mut input)?; + if matches.opt_present("events") { + print_events(&input, opts); + } else if matches.opt_present("dry-run") { + dry_run(&input, opts); } else { - let mut input = String::new(); - if let Err(why) = io::stdin().read_to_string(&mut input) { - panic!("couldn't read from stdin: {}", why) - } - if matches.opt_present("events") { - print_events(&input, opts); - } else if matches.opt_present("dry-run") { - dry_run(&input, opts); - } else { - print!("{}", render_html(&input, opts)); - } + let mut p = Parser::new_ext(&input, opts); + let stdio = io::stdout(); + let buffer = std::io::BufWriter::with_capacity(1024 * 1024, stdio.lock()); + html::write_html(buffer, &mut p)?; + // Since the program will now terminate and the memory will be returned + // to the operating system anyway, there is no point in tidely cleaning + // up all the datastructures we have used. We shouldn't do this if we'd + // do other things after this, because this is basically intentionally + // leaking data. Skipping cleanup lets us return a bit (~5%) faster. + mem::forget(p); } + Ok(()) } diff -Nru rust-pulldown-cmark-0.2.0/src/parse.rs rust-pulldown-cmark-0.8.0/src/parse.rs --- rust-pulldown-cmark-0.2.0/src/parse.rs 2018-11-07 16:31:08.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/src/parse.rs 2020-09-01 15:22:39.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright 2015 Google Inc. All rights reserved. +// Copyright 2017 Google Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -18,121 +18,162 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -//! Raw parser, for doing a single pass over input. +//! Tree-based two pass parser. -use scanners::*; -use utils; -use std::borrow::Cow; -use std::borrow::Cow::{Borrowed}; -use std::collections::{HashMap, HashSet}; -use std::collections::hash_map::Entry; -use std::cmp; - -#[derive(PartialEq, Debug)] -enum State { - StartBlock, - InContainers, - Inline, - TableHead(usize, usize), // limit, next - TableBody, - TableRow, - CodeLineStart, - Code, - InlineCode, - Literal, -} +use std::cmp::{max, min}; +use std::collections::{HashMap, VecDeque}; +use std::ops::{Index, Range}; + +use unicase::UniCase; + +use crate::linklabel::{scan_link_label_rest, LinkLabel, ReferenceLabel}; +use crate::scanners::*; +use crate::strings::CowStr; +use crate::tree::{Tree, TreeIndex}; + +// Allowing arbitrary depth nested parentheses inside link destinations +// can create denial of service vulnerabilities if we're not careful. +// The simplest countermeasure is to limit their depth, which is +// explicitly allowed by the spec as long as the limit is at least 3: +// https://spec.commonmark.org/0.29/#link-destination +const LINK_MAX_NESTED_PARENS: usize = 5; -#[derive(Copy, Clone, Debug, PartialEq)] -enum Container { - BlockQuote, - List(usize, u8), - ListItem(usize), - FootnoteDefinition, +/// Codeblock kind. +#[derive(Clone, Debug, PartialEq)] +pub enum CodeBlockKind<'a> { + Indented, + /// The value contained in the tag describes the language of the code, which may be empty. + Fenced(CowStr<'a>), } -pub struct RawParser<'a> { - text: &'a str, - off: usize, - - opts: Options, - active_tab: [u8; 256], - - state: State, - stack: Vec<(Tag<'a>, usize, usize)>, - leading_space: usize, - - containers: Vec, - last_line_was_empty: bool, - - /// In case we have a broken link/image reference, we can call this callback - /// with the reference name (both normalized and not normalized) and use - /// the link/title pair returned instead - broken_link_callback: Option<&'a Fn(&str, &str) -> Option<(String, String)>>, - - // state for code fences - fence_char: u8, - fence_count: usize, - fence_indent: usize, - - // info, used in second pass - loose_lists: HashSet, // offset is at list marker - links: HashMap, Cow<'a, str>)>, -} +impl<'a> CodeBlockKind<'a> { + pub fn is_indented(&self) -> bool { + match *self { + CodeBlockKind::Indented => true, + _ => false, + } + } -pub struct ParseInfo<'a> { - pub loose_lists: HashSet, - pub links: HashMap, Cow<'a, str>)>, + pub fn is_fenced(&self) -> bool { + match *self { + CodeBlockKind::Fenced(_) => true, + _ => false, + } + } } +/// Tags for elements that can contain other elements. #[derive(Clone, Debug, PartialEq)] pub enum Tag<'a> { - // block-level tags + /// A paragraph of text and other inline elements. Paragraph, - Rule, /// A heading. The field indicates the level of the heading. - Header(i32), + Heading(u32), BlockQuote, - CodeBlock(Cow<'a, str>), + /// A code block. + CodeBlock(CodeBlockKind<'a>), /// A list. If the list is ordered the field indicates the number of the first item. - List(Option), // TODO: add delim and tight for ast (not needed for html) + /// Contains only list items. + List(Option), // TODO: add delim and tight for ast (not needed for html) + /// A list item. Item, - FootnoteDefinition(Cow<'a, str>), + /// A footnote definition. The value contained is the footnote's label by which it can + /// be referred to. + FootnoteDefinition(CowStr<'a>), - // tables + /// A table. Contains a vector describing the text-alignment for each of its columns. Table(Vec), + /// A table header. Contains only `TableRow`s. Note that the table body starts immediately + /// after the closure of the `TableHead` tag. There is no `TableBody` tag. TableHead, + /// A table row. Is used both for header rows as body rows. Contains only `TableCell`s. TableRow, TableCell, // span-level tags Emphasis, Strong, - Code, + Strikethrough, + + /// A link. The first field is the link type, the second the destination URL and the third is a title. + Link(LinkType, CowStr<'a>, CowStr<'a>), - /// A link. The first field is the destination URL, the second is a title - Link(Cow<'a, str>, Cow<'a, str>), + /// An image. The first field is the link type, the second the destination URL and the third is a title. + Image(LinkType, CowStr<'a>, CowStr<'a>), +} + +/// Type specifier for inline links. See [the Tag::Link](enum.Tag.html#variant.Link) for more information. +#[derive(Clone, Debug, PartialEq, Copy)] +pub enum LinkType { + /// Inline link like `[foo](bar)` + Inline, + /// Reference link like `[foo][bar]` + Reference, + /// Reference without destination in the document, but resolved by the broken_link_callback + ReferenceUnknown, + /// Collapsed link like `[foo][]` + Collapsed, + /// Collapsed link without destination in the document, but resolved by the broken_link_callback + CollapsedUnknown, + /// Shortcut link like `[foo]` + Shortcut, + /// Shortcut without destination in the document, but resolved by the broken_link_callback + ShortcutUnknown, + /// Autolink like `` + Autolink, + /// Email address in autolink like `` + Email, +} - /// An image. The first field is the destination URL, the second is a title - Image(Cow<'a, str>, Cow<'a, str>), +impl LinkType { + fn to_unknown(self) -> Self { + match self { + LinkType::Reference => LinkType::ReferenceUnknown, + LinkType::Collapsed => LinkType::CollapsedUnknown, + LinkType::Shortcut => LinkType::ShortcutUnknown, + _ => unreachable!(), + } + } } +/// Markdown events that are generated in a preorder traversal of the document +/// tree, with additional `End` events whenever all of an inner node's children +/// have been visited. #[derive(Clone, Debug, PartialEq)] pub enum Event<'a> { + /// Start of a tagged element. Events that are yielded after this event + /// and before its corresponding `End` event are inside this element. + /// Start and end events are guaranteed to be balanced. Start(Tag<'a>), + /// End of a tagged element. End(Tag<'a>), - Text(Cow<'a, str>), - Html(Cow<'a, str>), - InlineHtml(Cow<'a, str>), - FootnoteReference(Cow<'a, str>), + /// A text node. + Text(CowStr<'a>), + /// An inline code node. + Code(CowStr<'a>), + /// An HTML node. + Html(CowStr<'a>), + /// A reference to a footnote with given label, which may or may not be defined + /// by an event with a `Tag::FootnoteDefinition` tag. Definitions and references to them may + /// occur in any order. + FootnoteReference(CowStr<'a>), + /// A soft line break. SoftBreak, + /// A hard line break. HardBreak, + /// A horizontal ruler. + Rule, + /// A task list marker, rendered as a checkbox in HTML. Contains a true when it is checked. + TaskListMarker(bool), } +/// Table column text alignment. #[derive(Copy, Clone, Debug, PartialEq)] pub enum Alignment { + /// Default text alignment. None, Left, Center, @@ -140,1617 +181,3194 @@ } bitflags! { + /// Option struct containing flags for enabling extra features + /// that are not part of the CommonMark spec. pub struct Options: u32 { - const FIRST_PASS = 1 << 0; const ENABLE_TABLES = 1 << 1; const ENABLE_FOOTNOTES = 1 << 2; + const ENABLE_STRIKETHROUGH = 1 << 3; + const ENABLE_TASKLISTS = 1 << 4; + const ENABLE_SMART_PUNCTUATION = 1 << 5; } } -const MAX_LINK_NEST: usize = 10; +#[derive(Debug, Default, Clone, Copy)] +struct Item { + start: usize, + end: usize, + body: ItemBody, +} -impl<'a> RawParser<'a> { - pub fn new_with_links_and_callback(text: &'a str, opts: Options, - links: HashMap, Cow<'a, str>)>, - callback: Option<&'a Fn(&str, &str) -> Option<(String, String)>>) - -> RawParser<'a> { - let mut ret = RawParser { - text: text, - off: if text.starts_with("\u{FEFF}") { 3 } else { 0 }, - opts: opts, - active_tab: [0; 256], - state: State::StartBlock, - leading_space: 0, - stack: Vec::new(), - containers: Vec::new(), - last_line_was_empty: false, - - fence_char: 0, - fence_count: 0, - fence_indent: 0, - - broken_link_callback: callback, - - // info, used in second pass - loose_lists: HashSet::new(), - links: links, - }; - ret.init_active(); - ret.skip_blank_lines(); - ret - } +#[derive(Debug, PartialEq, Clone, Copy)] +enum ItemBody { + Paragraph, + Text, + SoftBreak, + HardBreak, - pub fn new_with_links(text: &'a str, opts: Options, - links: HashMap, Cow<'a, str>)>) -> RawParser<'a> { - Self::new_with_links_and_callback(text, opts, links, None) - } + // These are possible inline items, need to be resolved in second pass. - pub fn new(text: &'a str, opts: Options) -> RawParser<'a> { - Self::new_with_links(text, opts, HashMap::new()) - } + // repeats, can_open, can_close + MaybeEmphasis(usize, bool, bool), + // quote byte, can_open, can_close + MaybeSmartQuote(u8, bool, bool), + MaybeCode(usize, bool), // number of backticks, preceeded by backslash + MaybeHtml, + MaybeLinkOpen, + // bool indicates whether or not the preceeding section could be a reference + MaybeLinkClose(bool), + MaybeImage, - // offset into text representing current parse position, hopefully - // useful for building source maps - pub fn get_offset(&self) -> usize { - self.off - } + // These are inline items after resolution. + Emphasis, + Strong, + Strikethrough, + Code(CowIndex), + Link(LinkIndex), + Image(LinkIndex), + FootnoteReference(CowIndex), + TaskListMarker(bool), // true for checked - // extract info from parser on finish - pub fn get_info(self) -> ParseInfo<'a> { - ParseInfo { - loose_lists: self.loose_lists, - links: self.links, - } - } + Rule, + Heading(u32), // heading level + FencedCodeBlock(CowIndex), + IndentCodeBlock, + Html, + OwnedHtml(CowIndex), + BlockQuote, + List(bool, u8, u64), // is_tight, list character, list start index + ListItem(usize), // indent level + SynthesizeText(CowIndex), + SynthesizeChar(char), + FootnoteDefinition(CowIndex), - fn init_active(&mut self) { - if self.opts.contains(Options::FIRST_PASS) { - self.active_tab[b'\n' as usize] = 1 - } else { - for &c in b"\x00\t\n\r_\\&*[!`<" { - self.active_tab[c as usize] = 1; - } - } - } + // Tables + Table(AlignmentIndex), + TableHead, + TableRow, + TableCell, + + // Dummy node at the top of the tree - should not be used otherwise! + Root, +} - fn limit(&self) -> usize { - match self.stack.last() { - Some(&(_, limit, _)) => limit, - None => self.text.len() +impl<'a> ItemBody { + fn is_inline(&self) -> bool { + match *self { + ItemBody::MaybeEmphasis(..) + | ItemBody::MaybeSmartQuote(..) + | ItemBody::MaybeHtml + | ItemBody::MaybeCode(..) + | ItemBody::MaybeLinkOpen + | ItemBody::MaybeLinkClose(..) + | ItemBody::MaybeImage => true, + _ => false, } } +} - // if end is not known, limit should be text.len(), next should be 0 - fn start(&mut self, tag: Tag<'a>, limit: usize, next: usize) -> Event<'a> { - self.stack.push((tag.clone(), limit, next)); - Event::Start(tag) +impl<'a> Default for ItemBody { + fn default() -> Self { + ItemBody::Root } +} - fn end(&mut self) -> Event<'a> { - let (tag, _, next) = self.stack.pop().unwrap(); - match tag { - // containers - Tag::BlockQuote | Tag::List(_) | Tag::Item | Tag::FootnoteDefinition(_) => { - let _ = self.containers.pop(); - } +/// Scanning modes for `Parser`'s `parse_line` method. +#[derive(PartialEq, Eq, Copy, Clone)] +enum TableParseMode { + /// Inside a paragraph, scanning for table headers. + Scan, + /// Inside a table. + Active, + /// Inside a paragraph, not scanning for table headers. + Disabled, +} - // block level tags - Tag::Paragraph | Tag::Header(_) | Tag::Rule | Tag::CodeBlock(_) | Tag::Table(_) => { - self.state = State::StartBlock; - // TODO: skip blank lines (for cleaner source maps) - } +pub struct BrokenLink<'a> { + pub span: std::ops::Range, + pub link_type: LinkType, + pub reference: &'a str, +} - // tables - Tag::TableCell => self.state = State::TableRow, - Tag::TableRow | Tag::TableHead => self.state = State::TableBody, +/// State for the first parsing pass. +/// +/// The first pass resolves all block structure, generating an AST. Within a block, items +/// are in a linear chain with potential inline markup identified. +struct FirstPass<'a, 'b> { + text: &'a str, + tree: Tree, + begin_list_item: bool, + last_line_blank: bool, + allocs: Allocations<'a>, + options: Options, + list_nesting: usize, + lookup_table: &'b LookupTable, +} - // inline - Tag::Code => self.state = State::Inline, - _ => (), +impl<'a, 'b> FirstPass<'a, 'b> { + fn new(text: &'a str, options: Options, lookup_table: &'b LookupTable) -> FirstPass<'a, 'b> { + // This is a very naive heuristic for the number of nodes + // we'll need. + let start_capacity = max(128, text.len() / 32); + let tree = Tree::with_capacity(start_capacity); + FirstPass { + text, + tree, + begin_list_item: false, + last_line_blank: false, + allocs: Allocations::new(), + options, + list_nesting: 0, + lookup_table, } - if next != 0 { self.off = next; } + } - /* - if self.stack.is_empty() { - // TODO maybe: make block ends do this - self.state = State::StartBlock; - self.skip_blank_lines(); + fn run(mut self) -> (Tree, Allocations<'a>) { + let mut ix = 0; + while ix < self.text.len() { + ix = self.parse_block(ix); + } + for _ in 0..self.tree.spine_len() { + self.pop(ix); } - */ - Event::End(tag) + (self.tree, self.allocs) } - fn skip_leading_whitespace(&mut self) { - self.off += scan_whitespace_no_nl(&self.text[self.off .. self.limit()]); - } + /// Returns offset after block. + fn parse_block(&mut self, mut start_ix: usize) -> usize { + let bytes = self.text.as_bytes(); + let mut line_start = LineStart::new(&bytes[start_ix..]); - // TODO: this function doesn't respect containers - fn skip_blank_lines(&mut self) { - loop { - let ret = scan_blank_line(&self.text[self.off..]); - if ret == 0 { - break; - } - self.off += ret; + let i = scan_containers(&self.tree, &mut line_start); + for _ in i..self.tree.spine_len() { + self.pop(start_ix); } - } - // Scan markers and indentation for current container stack - // Return: bytes scanned, whether containers are complete, and remaining space - fn scan_containers(&self, text: &str) -> (usize, bool, usize) { - let (mut i, mut space) = scan_leading_space(text, 0); - for container in &self.containers { - match *container { - Container::BlockQuote => { - if space <= 3 { - let n = scan_blockquote_start(&text[i..]); - if n > 0 { - let (n_sp, next_space) = scan_leading_space(text, i + n); - i += n + n_sp; - space = next_space; - } else { - return (i, false, space); - } - } else { - return (i, false, space); - } - } - Container::FootnoteDefinition | - Container::List(_, _) => (), - Container::ListItem(indent) => { - if space >= indent { - space -= indent; - } else if scan_eol(&text[i..]).1 { - space = 0; - } else { - return (i, false, 0); + if self.options.contains(Options::ENABLE_FOOTNOTES) { + // finish footnote if it's still open and was preceeded by blank line + if let Some(node_ix) = self.tree.peek_up() { + if let ItemBody::FootnoteDefinition(..) = self.tree[node_ix].item.body { + if self.last_line_blank { + self.pop(start_ix); } } } - } - (i, true, space) - } - // scans empty lines with current container stack - // returns number of bytes scanned, number of empty lines - // note: EOF counts as a line ending for counting lines - fn scan_empty_lines(&self, text: &str) -> (usize, usize) { - let mut i = 0; - let mut lines = 0; - loop { - let (n, scanned, _) = self.scan_containers(&text[i..]); - if !scanned { - return (i, lines); - } - if i == text.len() { - return (i, lines + 1); + // Footnote definitions of the form + // [^bar]: + // * anything really + let container_start = start_ix + line_start.bytes_scanned(); + if let Some(bytecount) = self.parse_footnote(container_start) { + start_ix = container_start + bytecount; + start_ix += scan_blank_line(&bytes[start_ix..]).unwrap_or(0); + line_start = LineStart::new(&bytes[start_ix..]); } - let n_blank = scan_eol(&text[i + n ..]).0; - if n_blank == 0 { - return (i, lines); - } - i += n + n_blank; - lines += 1; } - } - // scans whitespace, skipping past containers on newline - fn scan_whitespace_inline(&self, text: &str) -> usize { - let i = scan_whitespace_no_nl(text); - if let (n, true) = scan_eol(&text[i..]) { - let (n_containers, _, space) = self.scan_containers(&text[i + n ..]); - let j = i + n + n_containers; - if !self.is_inline_block_end(&text[j..], space) { - return j; + // Process new containers + loop { + let container_start = start_ix + line_start.bytes_scanned(); + if let Some((ch, index, indent)) = line_start.scan_list_marker() { + let after_marker_index = start_ix + line_start.bytes_scanned(); + self.continue_list(container_start, ch, index); + self.tree.append(Item { + start: container_start, + end: after_marker_index, // will get updated later if item not empty + body: ItemBody::ListItem(indent), + }); + self.tree.push(); + if let Some(n) = scan_blank_line(&bytes[after_marker_index..]) { + self.begin_list_item = true; + return after_marker_index + n; + } + if self.options.contains(Options::ENABLE_TASKLISTS) { + if let Some(is_checked) = line_start.scan_task_list_marker() { + self.tree.append(Item { + start: after_marker_index, + end: start_ix + line_start.bytes_scanned(), + body: ItemBody::TaskListMarker(is_checked), + }); + } + } + } else if line_start.scan_blockquote_marker() { + self.finish_list(start_ix); + self.tree.append(Item { + start: container_start, + end: 0, // will get set later + body: ItemBody::BlockQuote, + }); + self.tree.push(); + } else { + break; } } - i - } - fn at_list(&self, level: usize) -> Option { - let len = self.containers.len(); - if len >= level { - if let Container::List(offset, _) = self.containers[len - level] { - return Some(offset); - } - } - None - } + let ix = start_ix + line_start.bytes_scanned(); - fn start_block(&mut self) -> Option> { - let size = self.text.len(); - //println!("start_block {}", self.off); - while self.off < size { - //println!("start_block loop {} {}", self.off, self.last_line_was_empty); - if self.off >= self.limit() { - return Some(self.end()); - } - if self.state != State::InContainers { - let (n, scanned, space) = self.scan_containers(&self.text[self.off ..]); - if !scanned { - return Some(self.end()); - } - self.leading_space = space; - self.off += n; - self.state = State::InContainers; - } - - let (n, at_eol) = scan_eol(&self.text[self.off ..]); - if at_eol { - self.off += n; - self.state = State::StartBlock; - // two empty lines closes lists, one empty line closes a footnote - let (n, empty_lines) = self.scan_empty_lines(&self.text[self.off ..]); - for i in (0..self.stack.len()).rev() { - let is_break = match self.stack[i].0 { - Tag::List(_) => empty_lines >= 1, - Tag::Item => false, - Tag::FootnoteDefinition(_) => true, - _ => break, - }; - if is_break { - for tag in &mut self.stack[i..] { - tag.1 = self.off; // limit - tag.2 = self.off; // next + if let Some(n) = scan_blank_line(&bytes[ix..]) { + if let Some(node_ix) = self.tree.peek_up() { + match self.tree[node_ix].item.body { + ItemBody::BlockQuote => (), + _ => { + if self.begin_list_item { + // A list item can begin with at most one blank line. + self.pop(start_ix); } - self.stack[i].2 = self.off + n; // next - return Some(self.end()); + self.last_line_blank = true; } } - self.off += n; - if let Some(_) = self.at_list(2) { - self.last_line_was_empty = true; - } - continue; } + return ix + n; + } - //println!("checking loose {} {:?}", self.last_line_was_empty, self.at_list(2)); - if self.last_line_was_empty { - if let Some(offset) = self.at_list(2) { - // list item contains two blocks separated by empty line - self.loose_lists.insert(offset); - } - } + self.begin_list_item = false; + self.finish_list(start_ix); - if self.leading_space >= 4 && !self.at_list(1).is_some() { - // see below - if let Some(&Container::List(_, _)) = self.containers.last() { - return Some(self.end()); - } - return Some(self.start_indented_code()); - } + // Save `remaining_space` here to avoid needing to backtrack `line_start` for HTML blocks + let remaining_space = line_start.remaining_space(); + + let indent = line_start.scan_space_upto(4); + if indent == 4 { + let ix = start_ix + line_start.bytes_scanned(); + let remaining_space = line_start.remaining_space(); + return self.parse_indented_code_block(ix, remaining_space); + } - let tail = &self.text[self.off ..]; + let ix = start_ix + line_start.bytes_scanned(); - // must be before list item because ambiguous - let n = scan_hrule(tail); - if n != 0 { - self.last_line_was_empty = false; - // see below - if let Some(&Container::List(_, _)) = self.containers.last() { - return Some(self.end()); - } - self.off += n; - return Some(self.start_hrule()); + // HTML Blocks + if bytes[ix] == b'<' { + // Types 1-5 are all detected by one function and all end with the same + // pattern + if let Some(html_end_tag) = get_html_end_tag(&bytes[(ix + 1)..]) { + return self.parse_html_block_type_1_to_5(ix, html_end_tag, remaining_space); } - let (n, c, start, indent) = scan_listitem(tail); - if n != 0 { - if self.last_line_was_empty { - if let Some(offset) = self.at_list(1) { - // two list items separated by empty line - self.loose_lists.insert(offset); - } - } - self.last_line_was_empty = false; - return Some(self.start_listitem(n, c, start, indent)); + // Detect type 6 + let possible_tag = scan_html_block_tag(&bytes[(ix + 1)..]).1; + if is_html_tag(possible_tag) { + return self.parse_html_block_type_6_or_7(ix, remaining_space); } - // not a list item, so if we're in a list, close it - if let Some(&Container::List(_, _)) = self.containers.last() { - return Some(self.end()); + // Detect type 7 + if let Some(_html_bytes) = scan_html_type_7(&bytes[ix..]) { + return self.parse_html_block_type_6_or_7(ix, remaining_space); } - self.last_line_was_empty = false; + } - let c = tail.as_bytes()[0]; - match c { - b'#' => { - let (n, level) = scan_atx_header(tail); - if n != 0 { - self.off += n; - return Some(self.start_atx_header(level)); - } - } - b'`' | b'~' => { - let (n, ch) = scan_code_fence(tail); - if n != 0 { - return Some(self.start_code_fence(n, ch, n)); - } - } - b'>' => { - let n = scan_blockquote_start(tail); - if n != 0 { - self.off += n; - let (n, space) = scan_leading_space(self.text, self.off); - self.off += n; - self.leading_space = space; - self.containers.push(Container::BlockQuote); - return Some(self.start(Tag::BlockQuote, self.text.len(), 0)); - } - } - b'<' => { - if self.is_html_block(tail) { - return Some(self.do_html_block()); - } - } - b'[' => { - if self.opts.contains(Options::ENABLE_FOOTNOTES) { - if let Some((name, n)) = self.parse_footnote_definition(tail) { - if self.containers.last() == Some(&Container::FootnoteDefinition) { - return Some(self.end()); - } - self.off += n; - self.containers.push(Container::FootnoteDefinition); - return Some(self.start(Tag::FootnoteDefinition(Cow::Borrowed(name)), self.text.len(), 0)); - } - } - if self.try_link_reference_definition(tail) { - continue; - } - } - _ => () - } - return Some(self.start_paragraph()); + if let Ok(n) = scan_hrule(&bytes[ix..]) { + return self.parse_hrule(n, ix); } - None - } - // can start a paragraph, a setext header, or a table, as they start similarly - fn start_paragraph(&mut self) -> Event<'a> { - let mut i = self.off + scan_nextline(&self.text[self.off..]); - - if let (n, true, space) = self.scan_containers(&self.text[i..]) { - i += n; - if space <= 3 { - let (n, level) = scan_setext_header(&self.text[i..]); - if n != 0 { - let next = i + n; - while i > self.off && is_ascii_whitespace(self.text.as_bytes()[i - 1]) { - i -= 1; - } - self.state = State::Inline; - return self.start(Tag::Header(level), i, next); - } - if self.opts.contains(Options::ENABLE_TABLES) { - let (n, cols) = scan_table_head(&self.text[i..]); - if n != 0 { - let next = i + n; - while i > self.off && is_ascii_whitespace(self.text.as_bytes()[i - 1]) { - i -= 1; - } - self.state = State::TableHead(i, next); - return self.start(Tag::Table(cols), self.text.len(), 0); - } - } - } + if let Some(atx_size) = scan_atx_heading(&bytes[ix..]) { + return self.parse_atx_heading(ix, atx_size); } - let size = self.text.len(); - self.state = State::Inline; - self.start(Tag::Paragraph, size, 0) - } + // parse refdef + if let Some((bytecount, label, link_def)) = self.parse_refdef_total(ix) { + self.allocs.refdefs.entry(label).or_insert(link_def); + let ix = ix + bytecount; + // try to read trailing whitespace or it will register as a completely blank line + // TODO: shouldn't we do this for all block level items? + return ix + scan_blank_line(&bytes[ix..]).unwrap_or(0); + } - fn start_table_head(&mut self) -> Event<'a> { - assert!(self.opts.contains(Options::ENABLE_TABLES)); - if let State::TableHead(limit, next) = self.state { - self.state = State::TableRow; - return self.start(Tag::TableHead, limit, next); - } else { - panic!(); + if let Some((n, fence_ch)) = scan_code_fence(&bytes[ix..]) { + return self.parse_fenced_code_block(ix, indent, fence_ch, n); } + self.parse_paragraph(ix) } - fn start_table_body(&mut self) -> Event<'a> { - assert!(self.opts.contains(Options::ENABLE_TABLES)); - let (off, _) = match self.scan_containers(&self.text[self.off ..]) { - (n, true, space) => (self.off + n, space), - _ => { - return self.end(); - } - }; - let n = scan_blank_line(&self.text[off..]); - if n != 0 { - self.off = off + n; - return self.end(); - } - self.state = State::TableRow; - self.off = off; - self.start(Tag::TableRow, self.text.len(), 0) - } - - fn start_hrule(&mut self) -> Event<'a> { - let limit = self.off; // body of hrule is empty - self.state = State::Inline; // handy state for producing correct end tag - self.start(Tag::Rule, limit, limit) - } - - fn start_atx_header(&mut self, level: i32) -> Event<'a> { - self.skip_leading_whitespace(); - let tail = &self.text[self.off..]; - let next = scan_nextline(tail); - let mut limit = next; - while limit > 0 && is_ascii_whitespace(tail.as_bytes()[limit - 1]) { - limit -= 1; - } - let mut end = limit; - while end > 0 && tail.as_bytes()[end - 1] == b'#' { - end -= 1; - } - if end == 0 { - limit = end; - } else if is_ascii_whitespace(tail.as_bytes()[end - 1]) { - limit = end - 1; - } - while limit > 0 && is_ascii_whitespace(tail.as_bytes()[limit - 1]) { - limit -= 1; - } - let limit = limit + self.off; - let next = next + self.off; - self.state = State::Inline; - self.start(Tag::Header(level), limit, next) - } - - fn start_indented_code(&mut self) -> Event<'a> { - self.fence_char = b'\0'; - self.fence_indent = 4; - let size = self.text.len(); - self.state = State::Code; - self.start(Tag::CodeBlock(Borrowed("")), size, 0) - } - - fn start_listitem(&mut self, n: usize, c: u8, start: usize, indent: usize) -> Event<'a> { - let indent = self.leading_space + indent; - match self.containers.last() { - Some(&Container::List(_, c2)) => { - if c != c2 { - // mismatched list type or delimeter - return self.end(); - } - self.off += n; - let n_blank = scan_blank_line(&self.text[self.off ..]); - if n_blank != 0 { - self.off += n_blank; - self.state = State::StartBlock; - } else { - // TODO: deal with tab - let (n, space) = scan_leading_space(self.text, self.off); - self.off += n; - self.leading_space = space; - } - self.containers.push(Container::ListItem(indent)); - self.start(Tag::Item, self.text.len(), 0) - } - _ => { - self.containers.push(Container::List(self.off, c)); - // arguably this should be done in the scanner, it should return option - let startopt = if c == b'.' || c == b')' { Some(start) } else { None }; - self.start(Tag::List(startopt), self.text.len(), 0) - } + /// Returns the offset of the first line after the table. + /// Assumptions: current focus is a table element and the table header + /// matches the separator line (same number of columns). + fn parse_table(&mut self, table_cols: usize, head_start: usize, body_start: usize) -> usize { + // parse header. this shouldn't fail because we made sure the table header is ok + let (_sep_start, thead_ix) = self.parse_table_row_inner(head_start, table_cols); + self.tree[thead_ix].item.body = ItemBody::TableHead; + + // parse body + let mut ix = body_start; + while let Some((next_ix, _row_ix)) = self.parse_table_row(ix, table_cols) { + ix = next_ix; } + + self.pop(ix); + ix } - fn start_code_fence(&mut self, n: usize, ch: u8, count: usize) -> Event<'a> { - self.fence_char = ch; - self.fence_count = count; - self.fence_indent = self.leading_space; - let beg_info = self.off + n; - let next_line = beg_info + scan_nextline(&self.text[beg_info..]); - self.off = next_line; - let info = self.text[beg_info..next_line].trim(); - let size = self.text.len(); - self.state = State::CodeLineStart; - self.start(Tag::CodeBlock(Cow::Borrowed(info)), size, 0) - } - - fn next_code_line_start(&mut self) -> Event<'a> { - let (off, space) = match self.scan_containers(&self.text[self.off ..]) { - (n, true, space) => (self.off + n, space), - _ => { - return self.end(); + /// Call this when containers are taken care of. + /// Returns bytes scanned, row_ix + fn parse_table_row_inner(&mut self, mut ix: usize, row_cells: usize) -> (usize, TreeIndex) { + let bytes = self.text.as_bytes(); + let mut cells = 0; + let mut final_cell_ix = None; + + let row_ix = self.tree.append(Item { + start: ix, + end: 0, // set at end of this function + body: ItemBody::TableRow, + }); + self.tree.push(); + + loop { + ix += scan_ch(&bytes[ix..], b'|'); + ix += scan_whitespace_no_nl(&bytes[ix..]); + + if let Some(eol_bytes) = scan_eol(&bytes[ix..]) { + ix += eol_bytes; + break; } - }; - if self.fence_char == b'\0' { - let n = scan_blank_line(&self.text[off..]); - if n != 0 { - // TODO performance: this scanning is O(n^2) in the number of empty lines - let (n_empty, _lines) = self.scan_empty_lines(&self.text[off + n ..]); - let next = off + n + n_empty; - let (n_containers, scanned, nspace) = self.scan_containers(&self.text[next..]); - // TODO; handle space - if !scanned || self.is_code_block_end(next + n_containers, nspace) { - //println!("was end: {}", next + n_containers); - return self.end(); - } else { - self.off = off; - //println!("code line start space={}, off={}", space, off); - self.leading_space = space; - return self.next_code(); - } + let cell_ix = self.tree.append(Item { + start: ix, + end: ix, + body: ItemBody::TableCell, + }); + self.tree.push(); + let (next_ix, _brk) = self.parse_line(ix, TableParseMode::Active); + let trailing_whitespace = scan_rev_while(&bytes[..next_ix], is_ascii_whitespace); + + if let Some(cur_ix) = self.tree.cur() { + self.tree[cur_ix].item.end -= trailing_whitespace; } - } - if self.is_code_block_end(off, space) { - let ret = self.end(); - if self.fence_char != b'\0' { - self.off = off + scan_nextline(&self.text[off..]); + self.tree[cell_ix].item.end = next_ix - trailing_whitespace; + self.tree.pop(); + + ix = next_ix; + cells += 1; + + if cells == row_cells { + final_cell_ix = Some(cell_ix); } - ret - } else { - self.off = off; - self.state = State::Code; - self.leading_space = space; - self.next_code() } + + // fill empty cells if needed + // note: this is where GFM and commonmark-extra diverge. we follow + // GFM here + for _ in cells..row_cells { + self.tree.append(Item { + start: ix, + end: ix, + body: ItemBody::TableCell, + }); + } + + // drop excess cells + if let Some(cell_ix) = final_cell_ix { + self.tree[cell_ix].next = None; + } + + self.pop(ix); + + (ix, row_ix) } - fn next_code(&mut self) -> Event<'a> { - if self.leading_space > self.fence_indent { - // TODO: might try to combine spaces in text, for fewer events - let space = self.leading_space; - self.leading_space = 0; - return Event::Text(spaces(space - self.fence_indent)); + /// Returns first offset after the row and the tree index of the row. + fn parse_table_row(&mut self, mut ix: usize, row_cells: usize) -> Option<(usize, TreeIndex)> { + let bytes = self.text.as_bytes(); + let mut line_start = LineStart::new(&bytes[ix..]); + let containers = scan_containers(&self.tree, &mut line_start); + if containers != self.tree.spine_len() { + return None; + } + line_start.scan_all_space(); + ix += line_start.bytes_scanned(); + if scan_paragraph_interrupt(&bytes[ix..]) { + return None; } + + let (ix, row_ix) = self.parse_table_row_inner(ix, row_cells); + Some((ix, row_ix)) + } + + /// Returns offset of line start after paragraph. + fn parse_paragraph(&mut self, start_ix: usize) -> usize { + let node_ix = self.tree.append(Item { + start: start_ix, + end: 0, // will get set later + body: ItemBody::Paragraph, + }); + self.tree.push(); let bytes = self.text.as_bytes(); - let mut beg = self.off; - let mut i = beg; + + let mut ix = start_ix; loop { - match bytes[i..].iter().position(|&c| c < b' ') { - Some(j) => i += j, - None => { - i += bytes[i..].len(); - break; + let scan_mode = if self.options.contains(Options::ENABLE_TABLES) && ix == start_ix { + TableParseMode::Scan + } else { + TableParseMode::Disabled + }; + let (next_ix, brk) = self.parse_line(ix, scan_mode); + + // break out when we find a table + if let Some(Item { + body: ItemBody::Table(alignment_ix), + .. + }) = brk + { + let table_cols = self.allocs[alignment_ix].len(); + self.tree[node_ix].item.body = ItemBody::Table(alignment_ix); + // this clears out any stuff we may have appended - but there may + // be a cleaner way + self.tree[node_ix].child = None; + self.tree.pop(); + self.tree.push(); + return self.parse_table(table_cols, ix, next_ix); + } + + ix = next_ix; + let mut line_start = LineStart::new(&bytes[ix..]); + let n_containers = scan_containers(&self.tree, &mut line_start); + if !line_start.scan_space(4) { + let ix_new = ix + line_start.bytes_scanned(); + if n_containers == self.tree.spine_len() { + if let Some(ix_setext) = self.parse_setext_heading(ix_new, node_ix) { + if let Some(Item { + start, + body: ItemBody::HardBreak, + .. + }) = brk + { + if bytes[start] == b'\\' { + self.tree.append_text(start, start + 1); + } + } + ix = ix_setext; + break; + } } - } - match bytes[i] { - b'\n' => { - i += 1; - self.state = State::CodeLineStart; + // first check for non-empty lists, then for other interrupts + let suffix = &bytes[ix_new..]; + if self.interrupt_paragraph_by_list(suffix) || scan_paragraph_interrupt(suffix) { break; } - b'\r' => { - // just skip it (does not support '\r' only line break) - if i > beg { break; } - beg += 1; - } - _ => () } - i += 1; + line_start.scan_all_space(); + if line_start.is_at_eol() { + break; + } + ix = next_ix + line_start.bytes_scanned(); + if let Some(item) = brk { + self.tree.append(item); + } } - self.off = i; - Event::Text(Borrowed(&self.text[beg..i])) - } - fn is_code_block_end(&self, loc: usize, space: usize) -> bool { - let tail = &self.text[loc..]; - if self.fence_char == b'\0' { - // indented code block - space < 4 - } else if space <= 3 { - let (n, c) = scan_code_fence(tail); - c == self.fence_char && n >= self.fence_count && - (n >= tail.len() || scan_blank_line(&tail[n..]) != 0) - } else { - false - } + self.pop(ix); + ix } - // # HTML blocks + /// Returns end ix of setext_heading on success. + fn parse_setext_heading(&mut self, ix: usize, node_ix: TreeIndex) -> Option { + let bytes = self.text.as_bytes(); + let (n, level) = scan_setext_heading(&bytes[ix..])?; + self.tree[node_ix].item.body = ItemBody::Heading(level); - fn scan_html_block_tag(&self, data: &'a str) -> (usize, &'a str) { - let mut i = scan_ch(data, b'<'); - if i == 0 { return (0, "") } - i += scan_ch(&data[i..], b'/'); - let n = scan_while(&data[i..], is_ascii_alphanumeric); - // TODO: scan attributes and > - (i + n, &data[i .. i + n]) - } + // strip trailing whitespace + if let Some(cur_ix) = self.tree.cur() { + self.tree[cur_ix].item.end -= scan_rev_while( + &bytes[..self.tree[cur_ix].item.end], + is_ascii_whitespace_no_nl, + ); + } + + Some(ix + n) + } + + /// Parse a line of input, appending text and items to tree. + /// + /// Returns: index after line and an item representing the break. + fn parse_line(&mut self, start: usize, mode: TableParseMode) -> (usize, Option) { + let bytes = &self.text.as_bytes(); + let mut pipes = 0; + let mut last_pipe_ix = start; + let mut begin_text = start; + + let (final_ix, brk) = + iterate_special_bytes(&self.lookup_table, bytes, start, |ix, byte| { + match byte { + b'\n' | b'\r' => { + if let TableParseMode::Active = mode { + return LoopInstruction::BreakAtWith(ix, None); + } - fn is_html_block(&self, data: &str) -> bool { - let (n_tag, tag) = self.scan_html_block_tag(data); - (n_tag > 0 && is_html_tag(tag)) || - data.starts_with(" 0 { + // check if we may be parsing a table + let next_line_ix = ix + eol_bytes; + let mut line_start = LineStart::new(&bytes[next_line_ix..]); + if scan_containers(&self.tree, &mut line_start) == self.tree.spine_len() + { + let table_head_ix = next_line_ix + line_start.bytes_scanned(); + let (table_head_bytes, alignment) = + scan_table_head(&bytes[table_head_ix..]); + + if table_head_bytes > 0 { + // computing header count from number of pipes + let header_count = + count_header_cols(bytes, pipes, start, last_pipe_ix); + + // make sure they match the number of columns we find in separator line + if alignment.len() == header_count { + let alignment_ix = + self.allocs.allocate_alignment(alignment); + let end_ix = table_head_ix + table_head_bytes; + return LoopInstruction::BreakAtWith( + end_ix, + Some(Item { + start: i, + end: end_ix, // must update later + body: ItemBody::Table(alignment_ix), + }), + ); + } + } + } + } - // http://spec.commonmark.org/0.26/#html-blocks - fn get_html_tag(&self) -> Option<&'static str> { - static BEGIN_TAGS: &'static [&'static str; 3] = &["script", "pre", "style"]; - static END_TAGS: &'static [&'static str; 3] = &["", "", ""]; + let end_ix = ix + eol_bytes; + let trailing_backslashes = scan_rev_while(&bytes[..ix], |b| b == b'\\'); + if trailing_backslashes % 2 == 1 && end_ix < self.text.len() { + i -= 1; + self.tree.append_text(begin_text, i); + return LoopInstruction::BreakAtWith( + end_ix, + Some(Item { + start: i, + end: end_ix, + body: ItemBody::HardBreak, + }), + ); + } + let trailing_whitespace = + scan_rev_while(&bytes[..ix], is_ascii_whitespace_no_nl); + if trailing_whitespace >= 2 { + i -= trailing_whitespace; + self.tree.append_text(begin_text, i); + return LoopInstruction::BreakAtWith( + end_ix, + Some(Item { + start: i, + end: end_ix, + body: ItemBody::HardBreak, + }), + ); + } - for (beg_tag, end_tag) in BEGIN_TAGS.iter().zip(END_TAGS.iter()) { - if self.off + 1 + beg_tag.len() < self.text.len() && - self.text[self.off + 1..].starts_with(&beg_tag[..]) { - let pos = self.off + beg_tag.len() + 1; - let s = self.text.as_bytes()[pos]; - if s == b' ' || s == b'\n' || s == b'>' { - return Some(end_tag); - } + self.tree.append_text(begin_text, ix); + LoopInstruction::BreakAtWith( + end_ix, + Some(Item { + start: i, + end: end_ix, + body: ItemBody::SoftBreak, + }), + ) + } + b'\\' => { + if ix + 1 < self.text.len() && is_ascii_punctuation(bytes[ix + 1]) { + self.tree.append_text(begin_text, ix); + if bytes[ix + 1] == b'`' { + let count = 1 + scan_ch_repeat(&bytes[(ix + 2)..], b'`'); + self.tree.append(Item { + start: ix + 1, + end: ix + count + 1, + body: ItemBody::MaybeCode(count, true), + }); + begin_text = ix + 1 + count; + LoopInstruction::ContinueAndSkip(count) + } else { + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(1) + } + } else { + LoopInstruction::ContinueAndSkip(0) + } + } + c @ b'*' | c @ b'_' | c @ b'~' => { + let string_suffix = &self.text[ix..]; + let count = 1 + scan_ch_repeat(&string_suffix.as_bytes()[1..], c); + let can_open = delim_run_can_open(self.text, string_suffix, count, ix); + let can_close = delim_run_can_close(self.text, string_suffix, count, ix); + let is_valid_seq = c != b'~' || count == 2; + + if (can_open || can_close) && is_valid_seq { + self.tree.append_text(begin_text, ix); + for i in 0..count { + self.tree.append(Item { + start: ix + i, + end: ix + i + 1, + body: ItemBody::MaybeEmphasis(count - i, can_open, can_close), + }); + } + begin_text = ix + count; + } + LoopInstruction::ContinueAndSkip(count - 1) + } + b'`' => { + self.tree.append_text(begin_text, ix); + let count = 1 + scan_ch_repeat(&bytes[(ix + 1)..], b'`'); + self.tree.append(Item { + start: ix, + end: ix + count, + body: ItemBody::MaybeCode(count, false), + }); + begin_text = ix + count; + LoopInstruction::ContinueAndSkip(count - 1) + } + b'<' => { + // Note: could detect some non-HTML cases and early escape here, but not + // clear that's a win. + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeHtml, + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) + } + b'!' => { + if ix + 1 < self.text.len() && bytes[ix + 1] == b'[' { + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + 2, + body: ItemBody::MaybeImage, + }); + begin_text = ix + 2; + LoopInstruction::ContinueAndSkip(1) + } else { + LoopInstruction::ContinueAndSkip(0) + } + } + b'[' => { + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeLinkOpen, + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) + } + b']' => { + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeLinkClose(true), + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) + } + b'&' => match scan_entity(&bytes[ix..]) { + (n, Some(value)) => { + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + n, + body: ItemBody::SynthesizeText(self.allocs.allocate_cow(value)), + }); + begin_text = ix + n; + LoopInstruction::ContinueAndSkip(n - 1) + } + _ => LoopInstruction::ContinueAndSkip(0), + }, + b'|' => { + if let TableParseMode::Active = mode { + LoopInstruction::BreakAtWith(ix, None) + } else { + last_pipe_ix = ix; + pipes += 1; + LoopInstruction::ContinueAndSkip(0) + } + } + b'.' => { + if ix + 2 < bytes.len() && bytes[ix + 1] == b'.' && bytes[ix + 2] == b'.' { + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + 3, + body: ItemBody::SynthesizeChar('…'), + }); + begin_text = ix + 3; + LoopInstruction::ContinueAndSkip(2) + } else { + LoopInstruction::ContinueAndSkip(0) + } + } + b'-' => { + let count = 1 + scan_ch_repeat(&bytes[(ix + 1)..], b'-'); + if count == 1 { + LoopInstruction::ContinueAndSkip(0) + } else { + let itembody = if count == 2 { + ItemBody::SynthesizeChar('–') + } else if count == 3 { + ItemBody::SynthesizeChar('—') + } else { + let (ems, ens) = match count % 6 { + 0 | 3 => (count / 3, 0), + 2 | 4 => (0, count / 2), + 1 => (count / 3 - 1, 2), + _ => (count / 3, 1), + }; + // – and — are 3 bytes each in utf8 + let mut buf = String::with_capacity(3 * (ems + ens)); + for _ in 0..ems { + buf.push('—'); + } + for _ in 0..ens { + buf.push('–'); + } + ItemBody::SynthesizeText(self.allocs.allocate_cow(buf.into())) + }; + + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + count, + body: itembody, + }); + begin_text = ix + count; + LoopInstruction::ContinueAndSkip(count - 1) + } + } + c @ b'\'' | c @ b'"' => { + let string_suffix = &self.text[ix..]; + let can_open = delim_run_can_open(self.text, string_suffix, 1, ix); + let can_close = delim_run_can_close(self.text, string_suffix, 1, ix); + + self.tree.append_text(begin_text, ix); + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeSmartQuote(c, can_open, can_close), + }); + begin_text = ix + 1; + + LoopInstruction::ContinueAndSkip(0) + } + _ => LoopInstruction::ContinueAndSkip(0), + } + }); + + if brk.is_none() { + // need to close text at eof + self.tree.append_text(begin_text, final_ix); + } + (final_ix, brk) + } + + /// Check whether we should allow a paragraph interrupt by lists. Only non-empty + /// lists are allowed. + fn interrupt_paragraph_by_list(&self, suffix: &[u8]) -> bool { + scan_listitem(suffix).map_or(false, |(ix, delim, index, _)| { + self.list_nesting > 0 || + // we don't allow interruption by either empty lists or + // numbered lists starting at an index other than 1 + !scan_empty_list(&suffix[ix..]) && (delim == b'*' || delim == b'-' || index == 1) + }) + } + + /// When start_ix is at the beginning of an HTML block of type 1 to 5, + /// this will find the end of the block, adding the block itself to the + /// tree and also keeping track of the lines of HTML within the block. + /// + /// The html_end_tag is the tag that must be found on a line to end the block. + fn parse_html_block_type_1_to_5( + &mut self, + start_ix: usize, + html_end_tag: &str, + mut remaining_space: usize, + ) -> usize { + let bytes = self.text.as_bytes(); + let mut ix = start_ix; + loop { + let line_start_ix = ix; + ix += scan_nextline(&bytes[ix..]); + self.append_html_line(remaining_space, line_start_ix, ix); + + let mut line_start = LineStart::new(&bytes[ix..]); + let n_containers = scan_containers(&self.tree, &mut line_start); + if n_containers < self.tree.spine_len() { + break; } - } - static ST_BEGIN_TAGS: &'static [&'static str; 3] = &["", "?>", "]]>"]; - for (beg_tag, end_tag) in ST_BEGIN_TAGS.iter().zip(ST_END_TAGS.iter()) { - if self.off + 1 + beg_tag.len() < self.text.len() && - self.text[self.off + 1..].starts_with(&beg_tag[..]) { - return Some(end_tag); + + if (&self.text[line_start_ix..ix]).contains(html_end_tag) { + break; } - } - if self.off + 4 < self.text.len() && - self.text[self.off + 1..].starts_with("= 'A' && c <= 'Z' { - return Some(">"); + + let next_line_ix = ix + line_start.bytes_scanned(); + if next_line_ix == self.text.len() { + break; } + ix = next_line_ix; + remaining_space = line_start.remaining_space(); } - None + ix } - fn do_html_block(&mut self) -> Event<'a> { - let mut i = self.off; - if let Some(tag) = self.get_html_tag() { - let text = self.text[i..].split(tag).take(1).next().unwrap_or(""); - self.off = i + text.len(); - self.state = State::StartBlock; - return Event::Html(utils::cow_append(Borrowed(""), Borrowed(&self.text[i..self.off]))); - } - let size = self.text.len(); - let mut out = Borrowed(""); - let mut mark = i; + /// When start_ix is at the beginning of an HTML block of type 6 or 7, + /// this will consume lines until there is a blank line and keep track of + /// the HTML within the block. + fn parse_html_block_type_6_or_7( + &mut self, + start_ix: usize, + mut remaining_space: usize, + ) -> usize { + let bytes = self.text.as_bytes(); + let mut ix = start_ix; loop { - let n = scan_nextline(&self.text[i..]); - i += n; - if n >= 2 && self.text.as_bytes()[i - 2] == b'\r' { - if self.leading_space > 0 { - out = utils::cow_append(out, spaces(self.leading_space)); - self.leading_space = 0; - } - out = utils::cow_append(out, Borrowed(&self.text[mark .. i - 2])); - mark = i - 1; - } - let (n, scanned, space) = self.scan_containers(&self.text[i..]); - let n_blank = scan_blank_line(&self.text[i + n ..]); - if n != 0 || !scanned || i + n == size || n_blank != 0 { - if self.leading_space > 0 { - out = utils::cow_append(out, spaces(self.leading_space)); - } - self.leading_space = space; - out = utils::cow_append(out, Borrowed(&self.text[mark..i])); - mark = i + n; - } - if !scanned || i + n == size || n_blank != 0 { - self.off = i; // TODO: skip blank lines (cleaner source maps) - self.state = State::StartBlock; - return Event::Html(out) + let line_start_ix = ix; + ix += scan_nextline(&bytes[ix..]); + self.append_html_line(remaining_space, line_start_ix, ix); + + let mut line_start = LineStart::new(&bytes[ix..]); + let n_containers = scan_containers(&self.tree, &mut line_start); + if n_containers < self.tree.spine_len() || line_start.is_at_eol() { + break; } + + let next_line_ix = ix + line_start.bytes_scanned(); + if next_line_ix == self.text.len() || scan_blank_line(&bytes[next_line_ix..]).is_some() + { + break; + } + ix = next_line_ix; + remaining_space = line_start.remaining_space(); } + ix } - // # Link reference definitions - - fn try_link_reference_definition(&mut self, data: &'a str) -> bool { - let (n_link, text_beg, text_end, max_nest) = self.scan_link_label(data); - if n_link == 0 || max_nest > 1 { return false; } - let n_colon = scan_ch(&data[n_link ..], b':'); - if n_colon == 0 { return false; } - let mut i = n_link + n_colon; - i += self.scan_whitespace_inline(&data[i..]); - let linkdest = scan_link_dest(&data[i..]); - if linkdest.is_none() { return false; } - let (n_dest, raw_dest) = linkdest.unwrap(); - if n_dest == 0 { return false; } - i += n_dest; - i += scan_whitespace_no_nl(&data[i..]); - let n_nl = self.scan_whitespace_inline(&data[i..]); - let (n_title, title_beg, title_end) = self.scan_link_title(&data[i + n_nl ..]); - let title = if n_title == 0 { - Borrowed("") - } else { - let (title_beg, title_end) = (i + n_nl + title_beg, i + n_nl + title_end); - i += n_nl + n_title; - unescape(&data[title_beg..title_end]) - }; - i += scan_whitespace_no_nl(&data[i..]); - if let (n_eol, true) = scan_eol(&data[i..]) { - i += n_eol; - } else { - return false; - } + fn parse_indented_code_block(&mut self, start_ix: usize, mut remaining_space: usize) -> usize { + self.tree.append(Item { + start: start_ix, + end: 0, // will get set later + body: ItemBody::IndentCodeBlock, + }); + self.tree.push(); + let bytes = self.text.as_bytes(); + let mut last_nonblank_child = None; + let mut last_nonblank_ix = 0; + let mut end_ix = 0; + let mut last_line_blank = false; - let linktext = self.normalize_link_ref(&data[text_beg..text_end]); - if linktext.is_empty() { - return false; - } - if let Entry::Vacant(entry) = self.links.entry(linktext) { - let dest = unescape(raw_dest); - entry.insert((dest, title)); - } - self.state = State::StartBlock; - self.off += i; - true - } - - // normalize whitespace and case-fold - fn normalize_link_ref(&self, raw: &str) -> String { - let mut need_space = false; - let mut result = String::new(); - let mut i = 0; - while i < raw.len() { - let n = scan_nextline(&raw[i..]); - for c in raw[i.. i + n].chars() { - if c.is_whitespace() { - need_space = true; - } else { - if need_space && !result.is_empty() { - result.push(' '); - } - // TODO: Unicode case folding can differ from lowercase (ß) - result.extend(c.to_lowercase()); - need_space = false; - } - } - i += n; - if i == raw.len() { break; } - i += self.scan_containers(&raw[i..]).0; - need_space = true; - } - result - } - - // determine whether the line starting at loc ends the block - fn is_inline_block_end(&self, data: &str, space: usize) -> bool { - data.is_empty() || - scan_blank_line(data) != 0 || - space <= 3 && (scan_hrule(data) != 0 || - scan_atx_header(data).0 != 0 || - scan_code_fence(data).0 != 0 || - scan_blockquote_start(data) != 0 || - scan_listitem(data).0 != 0 || - self.is_html_block(data)) - } - - fn next_table_cell(&mut self) -> Event<'a> { - assert!(self.opts.contains(Options::ENABLE_TABLES)); - let bytes = self.text.as_bytes(); - let mut beg = self.off + scan_whitespace_no_nl(&self.text[self.off ..]); - let mut i = beg; - let limit = self.limit(); - if i < limit && bytes[i] == b'|' { - i += 1; - beg += 1; - self.off += 1; - } - if i >= limit { - self.off = limit; - return self.end(); - } - let mut n = 0; - while i < limit { - let c = bytes[i]; - if c == b'\\' && i + 1 < limit && bytes[i + 1] == b'|' { - i += 2; - continue; - } else if c == b'|' { - n = 0; + let mut ix = start_ix; + loop { + let line_start_ix = ix; + ix += scan_nextline(&bytes[ix..]); + self.append_code_text(remaining_space, line_start_ix, ix); + // TODO(spec clarification): should we synthesize newline at EOF? + + if !last_line_blank { + last_nonblank_child = self.tree.cur(); + last_nonblank_ix = ix; + end_ix = ix; + } + + let mut line_start = LineStart::new(&bytes[ix..]); + let n_containers = scan_containers(&self.tree, &mut line_start); + if n_containers < self.tree.spine_len() + || !(line_start.scan_space(4) || line_start.is_at_eol()) + { break; } - n = if is_ascii_whitespace(bytes[i]) { scan_blank_line(&self.text[i..]) } else { 0 }; - if n != 0 { - if i > beg { - n = 0; - } + let next_line_ix = ix + line_start.bytes_scanned(); + if next_line_ix == self.text.len() { break; } - i += 1; - } - if i > beg { - self.state = State::Inline; - self.start(Tag::TableCell, i, i + n) - } else { - self.off = i + n; - self.end() - } - } - - fn next_inline(&mut self) -> Event<'a> { + ix = next_line_ix; + remaining_space = line_start.remaining_space(); + last_line_blank = scan_blank_line(&bytes[ix..]).is_some(); + } + + // Trim trailing blank lines. + if let Some(child) = last_nonblank_child { + self.tree[child].next = None; + self.tree[child].item.end = last_nonblank_ix; + } + self.pop(end_ix); + ix + } + + fn parse_fenced_code_block( + &mut self, + start_ix: usize, + indent: usize, + fence_ch: u8, + n_fence_char: usize, + ) -> usize { let bytes = self.text.as_bytes(); - let beg = self.off; - let mut i = beg; - let limit = self.limit(); - while i < limit { - match bytes[i..limit].iter().position(|&c| self.active_tab[c as usize] != 0) { - Some(pos) => i += pos, - None => { i = limit; break; } + let mut info_start = start_ix + n_fence_char; + info_start += scan_whitespace_no_nl(&bytes[info_start..]); + // TODO: info strings are typically very short. wouldnt it be faster + // to just do a forward scan here? + let mut ix = info_start + scan_nextline(&bytes[info_start..]); + let info_end = ix - scan_rev_while(&bytes[info_start..ix], is_ascii_whitespace); + let info_string = unescape(&self.text[info_start..info_end]); + self.tree.append(Item { + start: start_ix, + end: 0, // will get set later + body: ItemBody::FencedCodeBlock(self.allocs.allocate_cow(info_string)), + }); + self.tree.push(); + loop { + let mut line_start = LineStart::new(&bytes[ix..]); + let n_containers = scan_containers(&self.tree, &mut line_start); + if n_containers < self.tree.spine_len() { + break; } - let c = bytes[i]; - if c == b'\n' || c == b'\r' { - let n = scan_trailing_whitespace(&self.text[beg..i]); - let end = i - n; - if end > beg { - self.off = end; - return Event::Text(Borrowed(&self.text[beg..end])); - } - if c == b'\r' && i + 1 < limit && self.text.as_bytes()[i + 1] == b'\n' { - i += 1; + line_start.scan_space(indent); + let mut close_line_start = line_start.clone(); + if !close_line_start.scan_space(4) { + let close_ix = ix + close_line_start.bytes_scanned(); + if let Some(n) = scan_closing_code_fence(&bytes[close_ix..], fence_ch, n_fence_char) + { + ix = close_ix + n; + break; } - i += 1; - let next = i; - let (n_containers, _, space) = self.scan_containers(&self.text[i..limit]); - i += n_containers; - if self.is_inline_block_end(&self.text[i..limit], space) { - self.off = next; - return self.end(); - } - i += scan_whitespace_no_nl(&self.text[i..limit]); - self.off = i; - return if n >= 2 { Event::HardBreak } else { Event::SoftBreak }; - } - self.off = i; - if i > beg { - return Event::Text(Borrowed(&self.text[beg..i])); - } - if let Some(event) = self.active_char(c) { - return event; } - i = self.off; // let handler advance offset even on None - i += 1; - } - if i > beg { - self.off = i; - Event::Text(Borrowed(&self.text[beg..i])) + let remaining_space = line_start.remaining_space(); + ix += line_start.bytes_scanned(); + let next_ix = ix + scan_nextline(&bytes[ix..]); + self.append_code_text(remaining_space, ix, next_ix); + ix = next_ix; + } + + self.pop(ix); + + // try to read trailing whitespace or it will register as a completely blank line + ix + scan_blank_line(&bytes[ix..]).unwrap_or(0) + } + + fn append_code_text(&mut self, remaining_space: usize, start: usize, end: usize) { + if remaining_space > 0 { + let cow_ix = self.allocs.allocate_cow(" "[..remaining_space].into()); + self.tree.append(Item { + start, + end: start, + body: ItemBody::SynthesizeText(cow_ix), + }); + } + if self.text.as_bytes()[end - 2] == b'\r' { + // Normalize CRLF to LF + self.tree.append_text(start, end - 2); + self.tree.append_text(end - 1, end); } else { - self.end() + self.tree.append_text(start, end); } } - fn active_char(&mut self, c: u8) -> Option> { - match c { - b'\x00' => Some(self.char_null()), - b'\t' => Some(self.char_tab()), - b'\\' => self.char_backslash(), - b'&' => self.char_entity(), - b'_' | - b'*' => self.char_emphasis(), - b'[' if self.opts.contains(Options::ENABLE_FOOTNOTES) => self.char_link_footnote(), - b'[' | b'!' => self.char_link(), - b'`' => self.char_backtick(), - b'<' => self.char_lt(), - _ => None - } - } - - fn char_null(&mut self) -> Event<'a> { - self.off += 1; - Event::Text(Borrowed("\u{fffd}")) - } - - // expand tab in content (used for code and inline) - // scan backward to find offset, counting unicode code points - fn char_tab(&mut self) -> Event<'a> { - let count = count_tab(&self.text.as_bytes()[.. self.off]); - self.off += 1; - Event::Text(Borrowed(&" "[..count])) - } - - fn char_backslash(&mut self) -> Option> { - let limit = self.limit(); - if self.off + 1 < limit { - if let (_, true) = scan_eol(&self.text[self.off + 1 .. limit]) { - let n_white = self.scan_whitespace_inline(&self.text[self.off + 1 .. limit]); - let space = 0; // TODO: figure this out - if !self.is_inline_block_end(&self.text[self.off + 1 + n_white .. limit], space) { - self.off += 1 + n_white; - return Some(Event::HardBreak); - } - } - let c = self.text.as_bytes()[self.off + 1]; - if is_ascii_punctuation(c) { - self.off += 2; - return Some(Event::Text(Borrowed(&self.text[self.off - 1 .. self.off]))); + /// Appends a line of HTML to the tree. + fn append_html_line(&mut self, remaining_space: usize, start: usize, end: usize) { + if remaining_space > 0 { + let cow_ix = self.allocs.allocate_cow(" "[..remaining_space].into()); + self.tree.append(Item { + start, + end: start, + // TODO: maybe this should synthesize to html rather than text? + body: ItemBody::SynthesizeText(cow_ix), + }); + } + if self.text.as_bytes()[end - 2] == b'\r' { + // Normalize CRLF to LF + self.tree.append(Item { + start, + end: end - 2, + body: ItemBody::Html, + }); + self.tree.append(Item { + start: end - 1, + end, + body: ItemBody::Html, + }); + } else { + self.tree.append(Item { + start, + end, + body: ItemBody::Html, + }); + } + } + + /// Pop a container, setting its end. + fn pop(&mut self, ix: usize) { + let cur_ix = self.tree.pop().unwrap(); + self.tree[cur_ix].item.end = ix; + if let ItemBody::List(true, _, _) = self.tree[cur_ix].item.body { + surgerize_tight_list(&mut self.tree, cur_ix); + } + } + + /// Close a list if it's open. Also set loose if last line was blank + fn finish_list(&mut self, ix: usize) { + if let Some(node_ix) = self.tree.peek_up() { + if let ItemBody::List(_, _, _) = self.tree[node_ix].item.body { + self.pop(ix); + self.list_nesting -= 1; + } + } + if self.last_line_blank { + if let Some(node_ix) = self.tree.peek_grandparent() { + if let ItemBody::List(ref mut is_tight, _, _) = self.tree[node_ix].item.body { + *is_tight = false; + } + } + self.last_line_blank = false; + } + } + + /// Continue an existing list or start a new one if there's not an open + /// list that matches. + fn continue_list(&mut self, start: usize, ch: u8, index: u64) { + if let Some(node_ix) = self.tree.peek_up() { + if let ItemBody::List(ref mut is_tight, existing_ch, _) = self.tree[node_ix].item.body { + if existing_ch == ch { + if self.last_line_blank { + *is_tight = false; + self.last_line_blank = false; + } + return; + } + } + // TODO: this is not the best choice for end; maybe get end from last list item. + self.finish_list(start); + } + self.tree.append(Item { + start, + end: 0, // will get set later + body: ItemBody::List(true, ch, index), + }); + self.list_nesting += 1; + self.tree.push(); + self.last_line_blank = false; + } + + /// Parse a thematic break. + /// + /// Returns index of start of next line. + fn parse_hrule(&mut self, hrule_size: usize, ix: usize) -> usize { + self.tree.append(Item { + start: ix, + end: ix + hrule_size, + body: ItemBody::Rule, + }); + ix + hrule_size + } + + /// Parse an ATX heading. + /// + /// Returns index of start of next line. + fn parse_atx_heading(&mut self, mut ix: usize, atx_size: usize) -> usize { + let heading_ix = self.tree.append(Item { + start: ix, + end: 0, // set later + body: ItemBody::Heading(atx_size as u32), + }); + ix += atx_size; + // next char is space or eol (guaranteed by scan_atx_heading) + let bytes = self.text.as_bytes(); + if let Some(eol_bytes) = scan_eol(&bytes[ix..]) { + self.tree[heading_ix].item.end = ix + eol_bytes; + return ix + eol_bytes; + } + // skip leading spaces + let skip_spaces = scan_whitespace_no_nl(&bytes[ix..]); + ix += skip_spaces; + + // now handle the header text + let header_start = ix; + let header_node_idx = self.tree.push(); // so that we can set the endpoint later + ix = self.parse_line(ix, TableParseMode::Disabled).0; + self.tree[header_node_idx].item.end = ix; + + // remove trailing matter from header text + if let Some(cur_ix) = self.tree.cur() { + let header_text = &bytes[header_start..ix]; + let mut limit = header_text + .iter() + .rposition(|&b| !(b == b'\n' || b == b'\r' || b == b' ')) + .map_or(0, |i| i + 1); + let closer = header_text[..limit] + .iter() + .rposition(|&b| b != b'#') + .map_or(0, |i| i + 1); + if closer == 0 { + limit = closer; + } else { + let spaces = scan_rev_while(&header_text[..closer], |b| b == b' '); + if spaces > 0 { + limit = closer - spaces; + } } + self.tree[cur_ix].item.end = limit + header_start; } - None + + self.tree.pop(); + ix } - fn char_entity(&mut self) -> Option> { - match scan_entity(&self.text[self.off ..]) { - (n, Some(value)) => { - self.off += n; - Some(Event::Text(value)) - } - _ => None + /// Returns the number of bytes scanned on success. + fn parse_footnote(&mut self, start: usize) -> Option { + let bytes = &self.text.as_bytes()[start..]; + if !bytes.starts_with(b"[^") { + return None; } - } + let (mut i, label) = self.parse_refdef_label(start + 2)?; + i += 2; + if scan_ch(&bytes[i..], b':') == 0 { + return None; + } + i += 1; + self.finish_list(start); + self.tree.append(Item { + start, + end: 0, // will get set later + // TODO: check whether the label here is strictly necessary + body: ItemBody::FootnoteDefinition(self.allocs.allocate_cow(label)), + }); + self.tree.push(); + Some(i) + } + + /// Tries to parse a reference label, which can be interrupted by new blocks. + /// On success, returns the number of bytes of the label and the label itself. + fn parse_refdef_label(&self, start: usize) -> Option<(usize, CowStr<'a>)> { + scan_link_label_rest(&self.text[start..], &|bytes| { + let mut line_start = LineStart::new(bytes); + let _ = scan_containers(&self.tree, &mut line_start); + let bytes_scanned = line_start.bytes_scanned(); - fn char_emphasis(&mut self) -> Option> { - // can see to left for flanking info, but not past limit - let limit = self.limit(); - let data = &self.text[..limit]; + let suffix = &bytes[bytes_scanned..]; + if self.interrupt_paragraph_by_list(suffix) || scan_paragraph_interrupt(suffix) { + None + } else { + Some(bytes_scanned) + } + }) + } - let c = data.as_bytes()[self.off]; - let (n, can_open, _can_close) = compute_open_close(data, self.off, c); - if !can_open { + /// Returns number of bytes scanned, label and definition on success. + fn parse_refdef_total(&mut self, start: usize) -> Option<(usize, LinkLabel<'a>, LinkDef<'a>)> { + let bytes = &self.text.as_bytes()[start..]; + if scan_ch(bytes, b'[') == 0 { return None; } - let mut stack = vec![n]; // TODO performance: don't allocate - let mut i = self.off + n; - while i < limit { - let c2 = data.as_bytes()[i]; - if c2 == b'\n' && !is_escaped(data, i) { - let (_, complete, space) = self.scan_containers(&self.text[i..]); - if !complete { - i += 1; - continue; - } - if self.is_inline_block_end(&self.text[i + 1 .. limit], space) { - return None - } else { - i += 1; - } - } else if c2 == c && !is_escaped(data, i) { - let (mut n2, can_open, can_close) = compute_open_close(data, i, c); - if can_close { - loop { - let ntos = stack.pop().unwrap(); - if ntos > n2 { - stack.push(ntos - n2); - break; - } - if stack.is_empty() { - let npop = if ntos < n2 { ntos } else { n2 }; - if npop == 1 { - self.off += 1; - return Some(self.start(Tag::Emphasis, i, i + 1)); - } else { - self.off += 2; - let next = i + npop; - return Some(self.start(Tag::Strong, next - 2, next)); - } - } else { - i += ntos; - n2 -= ntos; - } - } - } else if can_open { - stack.push(n2); - } - i += n2; - } else if c2 == b'`' { - let (n, beg, _) = self.scan_inline_code(&self.text[i..limit]); - if n != 0 { - i += n; - } else { - i += beg; - } - } else if c2 == b'<' { - let n = self.scan_autolink_or_html(&self.text[i..limit]); - if n != 0 { - i += n; - } else { - i += 1; - } - } else if c2 == b'[' { - if self.opts.contains(Options::ENABLE_FOOTNOTES) { - if let Some((_, n)) = self.parse_footnote(&self.text[i..limit]) { - i += n; - continue; - } - } - if let Some((_, _, _, n)) = self.parse_link(&self.text[i..limit], false) { - i += n; - } else { - i += 1; + let (mut i, label) = self.parse_refdef_label(start + 1)?; + i += 1; + if scan_ch(&bytes[i..], b':') == 0 { + return None; + } + i += 1; + let (bytecount, link_def) = self.scan_refdef(start + i)?; + Some((bytecount + i, UniCase::new(label), link_def)) + } + + /// Returns number of bytes and number of newlines + fn scan_refdef_space(&self, bytes: &[u8], mut i: usize) -> Option<(usize, usize)> { + let mut newlines = 0; + loop { + let whitespaces = scan_whitespace_no_nl(&bytes[i..]); + i += whitespaces; + if let Some(eol_bytes) = scan_eol(&bytes[i..]) { + i += eol_bytes; + newlines += 1; + if newlines > 1 { + return None; } } else { - i += 1; + break; + } + let mut line_start = LineStart::new(&bytes[i..]); + if self.tree.spine_len() != scan_containers(&self.tree, &mut line_start) { + return None; } + i += line_start.bytes_scanned(); } - None + Some((i, newlines)) } - // # Links + /// Returns # of bytes and definition. + /// Assumes the label of the reference including colon has already been scanned. + fn scan_refdef(&self, start: usize) -> Option<(usize, LinkDef<'a>)> { + let bytes = self.text.as_bytes(); - // scans a link label, example [link] - // return value is: total bytes, start of text, end of text, max nesting - fn scan_link_label(&self, data: &str) -> (usize, usize, usize, usize) { - let mut i = scan_ch(data, b'['); - if i == 0 { return (0, 0, 0, 0); } - let text_beg = i; - let mut max_nest = 1; - let mut nest = 1; - loop { - if i >= data.len() { return (0, 0, 0, 0); } - match data.as_bytes()[i] { - b'\n' => { - let n = self.scan_whitespace_inline(&data[i..]); - if n == 0 { return (0, 0, 0, 0); } - i += n; + // whitespace between label and url (including up to one newline) + let (mut i, _newlines) = self.scan_refdef_space(bytes, start)?; + + // scan link dest + let (dest_length, dest) = scan_link_dest(self.text, i, 1)?; + if dest_length == 0 { + return None; + } + let dest = unescape(dest); + i += dest_length; + + // no title + let mut backup = (i - start, LinkDef { dest, title: None }); + + // scan whitespace between dest and label + let (mut i, newlines) = + if let Some((new_i, mut newlines)) = self.scan_refdef_space(bytes, i) { + if i == self.text.len() { + newlines += 1; + } + if new_i == i && newlines == 0 { + return None; + } + if newlines > 1 { + return Some(backup); + }; + (new_i, newlines) + } else { + return Some(backup); + }; + + // scan title + // if this fails but newline == 1, return also a refdef without title + if let Some((title_length, title)) = scan_refdef_title(&self.text[i..]) { + i += title_length; + backup.1.title = Some(unescape(title)); + } else if newlines > 0 { + return Some(backup); + } else { + return None; + }; + + // scan EOL + if let Some(bytes) = scan_blank_line(&bytes[i..]) { + backup.0 = i + bytes - start; + Some(backup) + } else if newlines > 0 { + Some(backup) + } else { + None + } + } +} + +/// Returns number of containers scanned. +fn scan_containers(tree: &Tree, line_start: &mut LineStart) -> usize { + let mut i = 0; + for &node_ix in tree.walk_spine() { + match tree[node_ix].item.body { + ItemBody::BlockQuote => { + let save = line_start.clone(); + if !line_start.scan_blockquote_marker() { + *line_start = save; + break; } - b'[' => { - nest += 1; - if nest == MAX_LINK_NEST { return (0, 0, 0, 0); } - max_nest = cmp::max(max_nest, nest); - i += 1; - } - b']' => { - nest -= 1; - if nest == 0 { + } + ItemBody::ListItem(indent) => { + let save = line_start.clone(); + if !line_start.scan_space(indent) { + if !line_start.is_at_eol() { + *line_start = save; break; } - i += 1; - } - b'\\' => i += 1, - b'<' => { - let n = self.scan_autolink_or_html(&data[i..]); - if n != 0 { - i += n; - } else { - i += 1; - } } - b'`' => { - let (n, beg, _) = self.scan_inline_code(&data[i..]); - if n != 0 { - i += n; - } else { - i += beg; - } - } - _ => i += 1 } + _ => (), } - let text_end = i; - i += 1; // skip closing ] - (i, text_beg, text_end, max_nest) + i += 1; } + i +} - fn scan_link_title(&self, data: &str) -> (usize, usize, usize) { - let size = data.len(); - if size == 0 { return (0, 0, 0); } - let mut i = 0; - let titleclose = match data.as_bytes()[i] { - b'(' => b')', - b'\'' => b'\'', - b'\"' => b'\"', - _ => return (0, 0, 0) - }; - i += 1; - let title_beg = i; - while i < size { - match data.as_bytes()[i] { - x if x == titleclose => break, - b'\\' => i += 2, // may be > size - b'\n' => { - let n = self.scan_whitespace_inline(&data[i..]); - if n == 0 { return (0, 0, 0); } - i += n; +/// Computes the number of header columns in a table line by computing the number of dividing pipes +/// that aren't followed or preceeded by whitespace. +fn count_header_cols( + bytes: &[u8], + mut pipes: usize, + mut start: usize, + last_pipe_ix: usize, +) -> usize { + // was first pipe preceeded by whitespace? if so, subtract one + start += scan_whitespace_no_nl(&bytes[start..]); + if bytes[start] == b'|' { + pipes -= 1; + } + + // was last pipe followed by whitespace? if so, sub one + if scan_blank_line(&bytes[(last_pipe_ix + 1)..]).is_some() { + pipes + } else { + pipes + 1 + } +} + +impl<'a> Tree { + fn append_text(&mut self, start: usize, end: usize) { + if end > start { + if let Some(ix) = self.cur() { + if ItemBody::Text == self[ix].item.body && self[ix].item.end == start { + self[ix].item.end = end; + return; } - _ => i += 1 } + self.append(Item { + start, + end, + body: ItemBody::Text, + }); } - if i >= size { return (0, 0, 0); } - let title_end = i; - i += 1; - (i, title_beg, title_end) } +} - fn char_link(&mut self) -> Option> { - self.parse_link(&self.text[self.off .. self.limit()], false).map(|(tag, beg, end, n)| { - let off = self.off; - self.off += beg; - self.start(tag, off + end, off + n) - }) +/// Determines whether the delimiter run starting at given index is +/// left-flanking, as defined by the commonmark spec (and isn't intraword +/// for _ delims). +/// suffix is &s[ix..], which is passed in as an optimization, since taking +/// a string subslice is O(n). +fn delim_run_can_open(s: &str, suffix: &str, run_len: usize, ix: usize) -> bool { + let next_char = if let Some(c) = suffix.chars().nth(run_len) { + c + } else { + return false; + }; + if next_char.is_whitespace() { + return false; + } + if ix == 0 { + return true; + } + let delim = suffix.chars().next().unwrap(); + if delim == '*' && !is_punctuation(next_char) { + return true; } - // return: tag, begin, end, total size - fn parse_link(&self, data: &'a str, recur: bool) -> Option<(Tag<'a>, usize, usize, usize)> { - let size = data.len(); - - // scan link text - let i = scan_ch(data, b'!'); - let is_image = i == 1; - let (n, text_beg, text_end, max_nest) = self.scan_link_label(&data[i..]); - if n == 0 { return None; } - let (text_beg, text_end) = (text_beg + i, text_end + i); - if !is_image && !recur && max_nest > 1 && self.contains_link(&data[text_beg..text_end]) { - // disallow nested links in links (but ok in images) - return None; + let prev_char = s[..ix].chars().last().unwrap(); + + prev_char.is_whitespace() + || is_punctuation(prev_char) && (delim != '\'' || ![']', ')'].contains(&prev_char)) +} + +/// Determines whether the delimiter run starting at given index is +/// left-flanking, as defined by the commonmark spec (and isn't intraword +/// for _ delims) +fn delim_run_can_close(s: &str, suffix: &str, run_len: usize, ix: usize) -> bool { + if ix == 0 { + return false; + } + let prev_char = s[..ix].chars().last().unwrap(); + if prev_char.is_whitespace() { + return false; + } + let next_char = if let Some(c) = suffix.chars().nth(run_len) { + c + } else { + return true; + }; + let delim = suffix.chars().next().unwrap(); + if delim == '*' && !is_punctuation(prev_char) { + return true; + } + + next_char.is_whitespace() || is_punctuation(next_char) +} + +/// Checks whether we should break a paragraph on the given input. +/// Note: lists are dealt with in `interrupt_paragraph_by_list`, because determing +/// whether to break on a list requires additional context. +fn scan_paragraph_interrupt(bytes: &[u8]) -> bool { + if scan_eol(bytes).is_some() + || scan_hrule(bytes).is_ok() + || scan_atx_heading(bytes).is_some() + || scan_code_fence(bytes).is_some() + || scan_blockquote_start(bytes).is_some() + { + return true; + } + bytes.starts_with(b"<") + && (get_html_end_tag(&bytes[1..]).is_some() + || is_html_tag(scan_html_block_tag(&bytes[1..]).1)) +} + +/// Assumes `text_bytes` is preceded by `<`. +fn get_html_end_tag(text_bytes: &[u8]) -> Option<&'static str> { + static BEGIN_TAGS: &[&[u8]; 3] = &[b"pre", b"style", b"script"]; + static ST_BEGIN_TAGS: &[&[u8]; 3] = &[b"!--", b"?", b"![CDATA["]; + + for (beg_tag, end_tag) in BEGIN_TAGS + .iter() + .zip(["", "", ""].iter()) + { + let tag_len = beg_tag.len(); + + if text_bytes.len() < tag_len { + // begin tags are increasing in size + break; } - let mut i = i + n; - // scan dest - let (dest, title, beg, end, next) = if data[i..].starts_with('(') { - i += 1; - i += self.scan_whitespace_inline(&data[i..]); - if i >= size { return None; } + if !text_bytes[..tag_len].eq_ignore_ascii_case(beg_tag) { + continue; + } + + // Must either be the end of the line... + if text_bytes.len() == tag_len { + return Some(end_tag); + } + + // ...or be followed by whitespace, newline, or '>'. + let s = text_bytes[tag_len]; + if is_ascii_whitespace(s) || s == b'>' { + return Some(end_tag); + } + } + + for (beg_tag, end_tag) in ST_BEGIN_TAGS.iter().zip(["-->", "?>", "]]>"].iter()) { + if text_bytes.starts_with(beg_tag) { + return Some(end_tag); + } + } + + if text_bytes.len() > 1 + && text_bytes[0] == b'!' + && text_bytes[1] >= b'A' + && text_bytes[1] <= b'Z' + { + Some(">") + } else { + None + } +} + +#[derive(Copy, Clone, Debug)] +struct InlineEl { + start: TreeIndex, // offset of tree node + count: usize, + c: u8, // b'*' or b'_' + both: bool, // can both open and close +} + +#[derive(Debug, Clone, Default)] +struct InlineStack { + stack: Vec, + // Lower bounds for matching indices in the stack. For example + // a strikethrough delimiter will never match with any element + // in the stack with index smaller than + // `lower_bounds[InlineStack::TILDES]`. + lower_bounds: [usize; 7], +} - let linkdest = scan_link_dest(&data[i..]); - if linkdest.is_none() { return None; } - let (n, raw_dest) = linkdest.unwrap(); - let dest = unescape(raw_dest); - i += n; - - i += self.scan_whitespace_inline(&data[i..]); - if i == size { return None; } - - // scan title - let (n_title, title_beg, title_end) = self.scan_link_title(&data[i..]); - let title = if n_title == 0 { - Borrowed("") +impl InlineStack { + /// These are indices into the lower bounds array. + /// Not both refers to the property that the delimiter can not both + /// be opener as a closer. + const UNDERSCORE_NOT_BOTH: usize = 0; + const ASTERISK_NOT_BOTH: usize = 1; + const ASTERISK_BASE: usize = 2; + const TILDES: usize = 5; + const UNDERSCORE_BOTH: usize = 6; + + fn pop_all(&mut self, tree: &mut Tree) { + for el in self.stack.drain(..) { + for i in 0..el.count { + tree[el.start + i].item.body = ItemBody::Text; + } + } + self.lower_bounds = [0; 7]; + } + + fn get_lowerbound(&self, c: u8, count: usize, both: bool) -> usize { + if c == b'_' { + if both { + self.lower_bounds[InlineStack::UNDERSCORE_BOTH] } else { - let (title_beg, title_end) = (i + title_beg, i + title_end); - i += n_title; - // TODO: not just unescape, remove containers from newlines - unescape(&data[title_beg..title_end]) - }; - i += self.scan_whitespace_inline(&data[i..]); - if i == size || data.as_bytes()[i] != b')' { return None; } - i += 1; - (dest, title, text_beg, text_end, i) + self.lower_bounds[InlineStack::UNDERSCORE_NOT_BOTH] + } + } else if c == b'*' { + let mod3_lower = self.lower_bounds[InlineStack::ASTERISK_BASE + count % 3]; + if both { + mod3_lower + } else { + min( + mod3_lower, + self.lower_bounds[InlineStack::ASTERISK_NOT_BOTH], + ) + } } else { - // try link reference - let j = i + self.scan_whitespace_inline(&data[i..]); - let (n_ref, ref_beg, ref_end, _) = self.scan_link_label(&data[j..]); - let (ref_beg, ref_end) = if n_ref == 0 || ref_beg == ref_end { - (text_beg, text_end) + self.lower_bounds[InlineStack::TILDES] + } + } + + fn set_lowerbound(&mut self, c: u8, count: usize, both: bool, new_bound: usize) { + if c == b'_' { + if both { + self.lower_bounds[InlineStack::UNDERSCORE_BOTH] = new_bound; } else { - (j + ref_beg, j + ref_end) - }; - if n_ref != 0 { - i = j + n_ref; + self.lower_bounds[InlineStack::UNDERSCORE_NOT_BOTH] = new_bound; + } + } else if c == b'*' { + self.lower_bounds[InlineStack::ASTERISK_BASE + count % 3] = new_bound; + if !both { + self.lower_bounds[InlineStack::ASTERISK_NOT_BOTH] = new_bound; } - let reference = self.normalize_link_ref(&data[ref_beg..ref_end]); - let (dest, title) = match self.links.get(&reference) { - Some(&(ref dest, ref title)) => (dest.clone(), title.clone()), - None => { - if let Some(ref callback) = self.broken_link_callback { - if let Some(val) = callback(&reference, &data[ref_beg..ref_end]) { - (val.0.into(), val.1.into()) - } else { - return None; - } - } else { - return None; - } - } - }; - (dest, title, text_beg, text_end, i) - }; - if is_image { - Some((Tag::Image(dest, title), beg, end, next)) } else { - Some((Tag::Link(dest, title), beg, end, next)) + self.lower_bounds[InlineStack::TILDES] = new_bound; } } - // determine whether there's a link anywhere in the text - // TODO: code duplication with scan_link_label is unpleasant - fn contains_link(&self, data: &str) -> bool { - let mut i = 0; - while i < data.len() { - match data.as_bytes()[i] { - b'\n' => { - let n = self.scan_whitespace_inline(&data[i..]); - if n == 0 { return false; } - i += n; - continue; + fn find_match( + &mut self, + tree: &mut Tree, + c: u8, + count: usize, + both: bool, + ) -> Option { + let lowerbound = min(self.stack.len(), self.get_lowerbound(c, count, both)); + let res = self.stack[lowerbound..] + .iter() + .cloned() + .enumerate() + .rfind(|(_, el)| { + el.c == c && (!both && !el.both || (count + el.count) % 3 != 0 || count % 3 == 0) + }); + + if let Some((matching_ix, matching_el)) = res { + let matching_ix = matching_ix + lowerbound; + for el in &self.stack[(matching_ix + 1)..] { + for i in 0..el.count { + tree[el.start + i].item.body = ItemBody::Text; } - b'!' => { - if scan_ch(&data[i + 1 ..], b'[') != 0 { - // ok to contain image, skip over opening bracket - i += 1; - } - } - b'[' => { - if self.opts.contains(Options::ENABLE_FOOTNOTES) && self.parse_footnote(&data[i..]).is_some() { - return false; - } - if self.parse_link(&data[i..], true).is_some() { return true; } - } - b'\\' => i += 1, - b'<' => { - let n = self.scan_autolink_or_html(&data[i..]); - if n != 0 { - i += n; + } + self.stack.truncate(matching_ix); + Some(matching_el) + } else { + self.set_lowerbound(c, count, both, self.stack.len()); + None + } + } + + fn push(&mut self, el: InlineEl) { + self.stack.push(el) + } +} + +#[derive(Debug, Clone)] +enum RefScan<'a> { + // label, source ix of label end + LinkLabel(CowStr<'a>, usize), + // contains next node index + Collapsed(Option), + Failed, +} + +/// Skips forward within a block to a node which spans (ends inclusive) the given +/// index into the source. +fn scan_nodes_to_ix( + tree: &Tree, + mut node: Option, + ix: usize, +) -> Option { + while let Some(node_ix) = node { + if tree[node_ix].item.end <= ix { + node = tree[node_ix].next; + } else { + break; + } + } + node +} + +/// Scans an inline link label, which cannot be interrupted. +/// Returns number of bytes (including brackets) and label on success. +fn scan_link_label<'text, 'tree>( + tree: &'tree Tree, + text: &'text str, + allow_footnote_refs: bool, +) -> Option<(usize, ReferenceLabel<'text>)> { + let bytes = &text.as_bytes(); + if bytes.len() < 2 || bytes[0] != b'[' { + return None; + } + let linebreak_handler = |bytes: &[u8]| { + let mut line_start = LineStart::new(bytes); + let _ = scan_containers(tree, &mut line_start); + Some(line_start.bytes_scanned()) + }; + let pair = if allow_footnote_refs && b'^' == bytes[1] { + let (byte_index, cow) = scan_link_label_rest(&text[2..], &linebreak_handler)?; + (byte_index + 2, ReferenceLabel::Footnote(cow)) + } else { + let (byte_index, cow) = scan_link_label_rest(&text[1..], &linebreak_handler)?; + (byte_index + 1, ReferenceLabel::Link(cow)) + }; + Some(pair) +} + +fn scan_reference<'a, 'b>( + tree: &'a Tree, + text: &'b str, + cur: Option, + allow_footnote_refs: bool, +) -> RefScan<'b> { + let cur_ix = match cur { + None => return RefScan::Failed, + Some(cur_ix) => cur_ix, + }; + let start = tree[cur_ix].item.start; + let tail = &text.as_bytes()[start..]; + + if tail.starts_with(b"[]") { + let closing_node = tree[cur_ix].next.unwrap(); + RefScan::Collapsed(tree[closing_node].next) + } else if let Some((ix, ReferenceLabel::Link(label))) = + scan_link_label(tree, &text[start..], allow_footnote_refs) + { + RefScan::LinkLabel(label, start + ix) + } else { + RefScan::Failed + } +} + +#[derive(Clone, Default)] +struct LinkStack { + inner: Vec, + disabled_ix: usize, +} + +impl LinkStack { + fn push(&mut self, el: LinkStackEl) { + self.inner.push(el); + } + + fn pop(&mut self) -> Option { + let el = self.inner.pop(); + self.disabled_ix = std::cmp::min(self.disabled_ix, self.inner.len()); + el + } + + fn clear(&mut self) { + self.inner.clear(); + self.disabled_ix = 0; + } + + fn disable_all_links(&mut self) { + for el in &mut self.inner[self.disabled_ix..] { + if el.ty == LinkStackTy::Link { + el.ty = LinkStackTy::Disabled; + } + } + self.disabled_ix = self.inner.len(); + } +} + +#[derive(Clone, Debug)] +struct LinkStackEl { + node: TreeIndex, + ty: LinkStackTy, +} + +#[derive(PartialEq, Clone, Debug)] +enum LinkStackTy { + Link, + Image, + Disabled, +} + +#[derive(Clone)] +struct LinkDef<'a> { + dest: CowStr<'a>, + title: Option>, +} + +/// Tracks tree indices of code span delimiters of each length. It should prevent +/// quadratic scanning behaviours by providing (amortized) constant time lookups. +struct CodeDelims { + inner: HashMap>, + seen_first: bool, +} + +impl CodeDelims { + fn new() -> Self { + Self { + inner: Default::default(), + seen_first: false, + } + } + + fn insert(&mut self, count: usize, ix: TreeIndex) { + if self.seen_first { + self.inner + .entry(count) + .or_insert_with(Default::default) + .push_back(ix); + } else { + // Skip the first insert, since that delimiter will always + // be an opener and not a closer. + self.seen_first = true; + } + } + + fn is_populated(&self) -> bool { + !self.inner.is_empty() + } + + fn find(&mut self, open_ix: TreeIndex, count: usize) -> Option { + while let Some(ix) = self.inner.get_mut(&count)?.pop_front() { + if ix > open_ix { + return Some(ix); + } + } + None + } + + fn clear(&mut self) { + self.inner.clear(); + self.seen_first = false; + } +} + +#[derive(Copy, Clone, PartialEq, Eq, Debug)] +struct LinkIndex(usize); + +#[derive(Copy, Clone, PartialEq, Eq, Debug)] +struct CowIndex(usize); + +#[derive(Copy, Clone, PartialEq, Eq, Debug)] +struct AlignmentIndex(usize); + +#[derive(Clone)] +struct Allocations<'a> { + refdefs: HashMap, LinkDef<'a>>, + links: Vec<(LinkType, CowStr<'a>, CowStr<'a>)>, + cows: Vec>, + alignments: Vec>, +} + +impl<'a> Allocations<'a> { + fn new() -> Self { + Self { + refdefs: HashMap::new(), + links: Vec::with_capacity(128), + cows: Vec::new(), + alignments: Vec::new(), + } + } + + fn allocate_cow(&mut self, cow: CowStr<'a>) -> CowIndex { + let ix = self.cows.len(); + self.cows.push(cow); + CowIndex(ix) + } + + fn allocate_link(&mut self, ty: LinkType, url: CowStr<'a>, title: CowStr<'a>) -> LinkIndex { + let ix = self.links.len(); + self.links.push((ty, url, title)); + LinkIndex(ix) + } + + fn allocate_alignment(&mut self, alignment: Vec) -> AlignmentIndex { + let ix = self.alignments.len(); + self.alignments.push(alignment); + AlignmentIndex(ix) + } +} + +impl<'a> Index for Allocations<'a> { + type Output = CowStr<'a>; + + fn index(&self, ix: CowIndex) -> &Self::Output { + self.cows.index(ix.0) + } +} + +impl<'a> Index for Allocations<'a> { + type Output = (LinkType, CowStr<'a>, CowStr<'a>); + + fn index(&self, ix: LinkIndex) -> &Self::Output { + self.links.index(ix.0) + } +} + +impl<'a> Index for Allocations<'a> { + type Output = Vec; + + fn index(&self, ix: AlignmentIndex) -> &Self::Output { + self.alignments.index(ix.0) + } +} + +/// A struct containing information on the reachability of certain inline HTML +/// elements. In particular, for cdata elements (` [bool; 256] { + let mut bytes = [false; 256]; + let standard_bytes = [ + b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', + ]; + + for &byte in &standard_bytes { + bytes[byte as usize] = true; + } + if options.contains(Options::ENABLE_TABLES) { + bytes[b'|' as usize] = true; + } + if options.contains(Options::ENABLE_STRIKETHROUGH) { + bytes[b'~' as usize] = true; + } + if options.contains(Options::ENABLE_SMART_PUNCTUATION) { + for &byte in &[b'.', b'-', b'"', b'\''] { + bytes[byte as usize] = true; + } + } + + bytes +} + +pub(crate) fn create_lut(options: &Options) -> LookupTable { + #[cfg(all(target_arch = "x86_64", feature = "simd"))] + { + LookupTable { + simd: crate::simd::compute_lookup(options), + scalar: special_bytes(options), + } + } + #[cfg(not(all(target_arch = "x86_64", feature = "simd")))] + { + special_bytes(options) + } +} + +pub type BrokenLinkCallback<'a> = + Option<&'a mut dyn FnMut(BrokenLink) -> Option<(CowStr<'a>, CowStr<'a>)>>; + +/// Markdown event iterator. +pub struct Parser<'a> { + text: &'a str, + options: Options, + tree: Tree, + allocs: Allocations<'a>, + broken_link_callback: BrokenLinkCallback<'a>, + html_scan_guard: HtmlScanGuard, + + // used by inline passes. store them here for reuse + inline_stack: InlineStack, + link_stack: LinkStack, +} + +impl<'a> Parser<'a> { + /// Creates a new event iterator for a markdown string without any options enabled. + pub fn new(text: &'a str) -> Parser<'a> { + Parser::new_ext(text, Options::empty()) + } + + /// Creates a new event iterator for a markdown string with given options. + pub fn new_ext(text: &'a str, options: Options) -> Parser<'a> { + Parser::new_with_broken_link_callback(text, options, None) + } + + /// In case the parser encounters any potential links that have a broken + /// reference (e.g `[foo]` when there is no `[foo]: ` entry at the bottom) + /// the provided callback will be called with the reference name, + /// and the returned pair will be used as the link name and title if it is not + /// `None`. + pub fn new_with_broken_link_callback( + text: &'a str, + options: Options, + broken_link_callback: BrokenLinkCallback<'a>, + ) -> Parser<'a> { + let lut = create_lut(&options); + let first_pass = FirstPass::new(text, options, &lut); + let (mut tree, allocs) = first_pass.run(); + tree.reset(); + let inline_stack = Default::default(); + let link_stack = Default::default(); + let html_scan_guard = Default::default(); + Parser { + text, + options, + tree, + allocs, + broken_link_callback, + inline_stack, + link_stack, + html_scan_guard, + } + } + + /// Handle inline markup. + /// + /// When the parser encounters any item indicating potential inline markup, all + /// inline markup passes are run on the remainder of the chain. + /// + /// Note: there's some potential for optimization here, but that's future work. + fn handle_inline(&mut self) { + self.handle_inline_pass1(); + self.handle_emphasis(); + } + + /// Handle inline HTML, code spans, and links. + /// + /// This function handles both inline HTML and code spans, because they have + /// the same precedence. It also handles links, even though they have lower + /// precedence, because the URL of links must not be processed. + fn handle_inline_pass1(&mut self) { + let mut code_delims = CodeDelims::new(); + let mut cur = self.tree.cur(); + let mut prev = None; + + let block_end = self.tree[self.tree.peek_up().unwrap()].item.end; + let block_text = &self.text[..block_end]; + + while let Some(mut cur_ix) = cur { + match self.tree[cur_ix].item.body { + ItemBody::MaybeHtml => { + let next = self.tree[cur_ix].next; + let autolink = if let Some(next_ix) = next { + scan_autolink(block_text, self.tree[next_ix].item.start) } else { - i += 1; + None + }; + + if let Some((ix, uri, link_type)) = autolink { + let node = scan_nodes_to_ix(&self.tree, next, ix); + let text_node = self.tree.create_node(Item { + start: self.tree[cur_ix].item.start + 1, + end: ix - 1, + body: ItemBody::Text, + }); + let link_ix = self.allocs.allocate_link(link_type, uri, "".into()); + self.tree[cur_ix].item.body = ItemBody::Link(link_ix); + self.tree[cur_ix].item.end = ix; + self.tree[cur_ix].next = node; + self.tree[cur_ix].child = Some(text_node); + prev = cur; + cur = node; + if let Some(node_ix) = cur { + self.tree[node_ix].item.start = max(self.tree[node_ix].item.start, ix); + } + continue; + } else { + let inline_html = next.and_then(|next_ix| { + self.scan_inline_html( + block_text.as_bytes(), + self.tree[next_ix].item.start, + ) + }); + if let Some((span, ix)) = inline_html { + let node = scan_nodes_to_ix(&self.tree, next, ix); + self.tree[cur_ix].item.body = if !span.is_empty() { + let converted_string = + String::from_utf8(span).expect("invalid utf8"); + ItemBody::OwnedHtml( + self.allocs.allocate_cow(converted_string.into()), + ) + } else { + ItemBody::Html + }; + self.tree[cur_ix].item.end = ix; + self.tree[cur_ix].next = node; + prev = cur; + cur = node; + if let Some(node_ix) = cur { + self.tree[node_ix].item.start = + max(self.tree[node_ix].item.start, ix); + } + continue; + } } + self.tree[cur_ix].item.body = ItemBody::Text; } - b'`' => { - let (n, beg, _) = self.scan_inline_code(&data[i..]); - if n != 0 { - i += n; + ItemBody::MaybeCode(mut search_count, preceded_by_backslash) => { + if preceded_by_backslash { + search_count -= 1; + if search_count == 0 { + self.tree[cur_ix].item.body = ItemBody::Text; + prev = cur; + cur = self.tree[cur_ix].next; + continue; + } + } + + if code_delims.is_populated() { + // we have previously scanned all codeblock delimiters, + // so we can reuse that work + if let Some(scan_ix) = code_delims.find(cur_ix, search_count) { + self.make_code_span(cur_ix, scan_ix, preceded_by_backslash); + } else { + self.tree[cur_ix].item.body = ItemBody::Text; + } } else { - i += beg; + // we haven't previously scanned all codeblock delimiters, + // so walk the AST + let mut scan = if search_count > 0 { + self.tree[cur_ix].next + } else { + None + }; + while let Some(scan_ix) = scan { + if let ItemBody::MaybeCode(delim_count, _) = + self.tree[scan_ix].item.body + { + if search_count == delim_count { + self.make_code_span(cur_ix, scan_ix, preceded_by_backslash); + code_delims.clear(); + break; + } else { + code_delims.insert(delim_count, scan_ix); + } + } + scan = self.tree[scan_ix].next; + } + if scan == None { + self.tree[cur_ix].item.body = ItemBody::Text; + } + } + } + ItemBody::MaybeLinkOpen => { + self.tree[cur_ix].item.body = ItemBody::Text; + self.link_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Link, + }); + } + ItemBody::MaybeImage => { + self.tree[cur_ix].item.body = ItemBody::Text; + self.link_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Image, + }); + } + ItemBody::MaybeLinkClose(could_be_ref) => { + self.tree[cur_ix].item.body = ItemBody::Text; + if let Some(tos) = self.link_stack.pop() { + if tos.ty == LinkStackTy::Disabled { + continue; + } + let next = self.tree[cur_ix].next; + if let Some((next_ix, url, title)) = + self.scan_inline_link(block_text, self.tree[cur_ix].item.end, next) + { + let next_node = scan_nodes_to_ix(&self.tree, next, next_ix); + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + cur = Some(tos.node); + cur_ix = tos.node; + let link_ix = self.allocs.allocate_link(LinkType::Inline, url, title); + self.tree[cur_ix].item.body = if tos.ty == LinkStackTy::Image { + ItemBody::Image(link_ix) + } else { + ItemBody::Link(link_ix) + }; + self.tree[cur_ix].child = self.tree[cur_ix].next; + self.tree[cur_ix].next = next_node; + self.tree[cur_ix].item.end = next_ix; + if let Some(next_node_ix) = next_node { + self.tree[next_node_ix].item.start = + max(self.tree[next_node_ix].item.start, next_ix); + } + + if tos.ty == LinkStackTy::Link { + self.link_stack.disable_all_links(); + } + } else { + // ok, so its not an inline link. maybe it is a reference + // to a defined link? + let scan_result = scan_reference( + &self.tree, + block_text, + next, + self.options.contains(Options::ENABLE_FOOTNOTES), + ); + let (node_after_link, link_type) = match scan_result { + // [label][reference] + RefScan::LinkLabel(_, end_ix) => { + // Toggle reference viability of the last closing bracket, + // so that we can skip it on future iterations in case + // it fails in this one. In particular, we won't call + // the broken link callback twice on one reference. + let reference_close_node = + scan_nodes_to_ix(&self.tree, next, end_ix - 1).unwrap(); + self.tree[reference_close_node].item.body = + ItemBody::MaybeLinkClose(false); + let next_node = self.tree[reference_close_node].next; + + (next_node, LinkType::Reference) + } + // [reference][] + RefScan::Collapsed(next_node) => { + // This reference has already been tried, and it's not + // valid. Skip it. + if !could_be_ref { + continue; + } + (next_node, LinkType::Collapsed) + } + // [shortcut] + // + // [shortcut]: /blah + RefScan::Failed => { + if !could_be_ref { + continue; + } + (next, LinkType::Shortcut) + } + }; + + // FIXME: references and labels are mixed in the naming of variables + // below. Disambiguate! + + // (label, source_ix end) + let label: Option<(ReferenceLabel<'a>, usize)> = match scan_result { + RefScan::LinkLabel(l, end_ix) => { + Some((ReferenceLabel::Link(l), end_ix)) + } + RefScan::Collapsed(..) | RefScan::Failed => { + // No label? maybe it is a shortcut reference + let label_start = self.tree[tos.node].item.end - 1; + scan_link_label( + &self.tree, + &self.text[label_start..self.tree[cur_ix].item.end], + self.options.contains(Options::ENABLE_FOOTNOTES), + ) + .map(|(ix, label)| (label, label_start + ix)) + } + }; + + // see if it's a footnote reference + if let Some((ReferenceLabel::Footnote(l), end)) = label { + self.tree[tos.node].next = node_after_link; + self.tree[tos.node].child = None; + self.tree[tos.node].item.body = + ItemBody::FootnoteReference(self.allocs.allocate_cow(l)); + self.tree[tos.node].item.end = end; + prev = Some(tos.node); + cur = node_after_link; + self.link_stack.clear(); + continue; + } else if let Some((ReferenceLabel::Link(link_label), end)) = label { + let type_url_title = self + .allocs + .refdefs + .get(&UniCase::new(link_label.as_ref().into())) + .map(|matching_def| { + // found a matching definition! + let title = matching_def + .title + .as_ref() + .cloned() + .unwrap_or_else(|| "".into()); + let url = matching_def.dest.clone(); + (link_type, url, title) + }) + .or_else(|| { + match self.broken_link_callback.as_mut() { + Some(callback) => { + // Construct a BrokenLink struct, which will be passed to the callback + let broken_link = BrokenLink { + span: (self.tree[tos.node].item.start)..end, + link_type: link_type, + reference: link_label.as_ref(), + }; + + callback(broken_link).map(|(url, title)| { + (link_type.to_unknown(), url, title) + }) + } + None => None, + } + }); + + if let Some((def_link_type, url, title)) = type_url_title { + let link_ix = + self.allocs.allocate_link(def_link_type, url, title); + self.tree[tos.node].item.body = if tos.ty == LinkStackTy::Image + { + ItemBody::Image(link_ix) + } else { + ItemBody::Link(link_ix) + }; + let label_node = self.tree[tos.node].next; + + // lets do some tree surgery to add the link to the tree + // 1st: skip the label node and close node + self.tree[tos.node].next = node_after_link; + + // then, if it exists, add the label node as a child to the link node + if label_node != cur { + self.tree[tos.node].child = label_node; + + // finally: disconnect list of children + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + } + + self.tree[tos.node].item.end = end; + + // set up cur so next node will be node_after_link + cur = Some(tos.node); + cur_ix = tos.node; + + if tos.ty == LinkStackTy::Link { + self.link_stack.disable_all_links(); + } + } + } + } } } - _ => () + _ => (), } - i += 1; + prev = cur; + cur = self.tree[cur_ix].next; } - false + self.link_stack.clear(); } - // # Footnotes + fn handle_emphasis(&mut self) { + let mut prev = None; + let mut prev_ix: TreeIndex; + let mut cur = self.tree.cur(); + + let mut single_quote_open: Option = None; + let mut double_quote_open: bool = false; + + while let Some(mut cur_ix) = cur { + match self.tree[cur_ix].item.body { + ItemBody::MaybeEmphasis(mut count, can_open, can_close) => { + let c = self.text.as_bytes()[self.tree[cur_ix].item.start]; + let both = can_open && can_close; + if can_close { + while let Some(el) = + self.inline_stack.find_match(&mut self.tree, c, count, both) + { + // have a match! + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + let match_count = min(count, el.count); + // start, end are tree node indices + let mut end = cur_ix - 1; + let mut start = el.start + el.count; + + // work from the inside out + while start > el.start + el.count - match_count { + let (inc, ty) = if c == b'~' { + (2, ItemBody::Strikethrough) + } else if start > el.start + el.count - match_count + 1 { + (2, ItemBody::Strong) + } else { + (1, ItemBody::Emphasis) + }; + + let root = start - inc; + end = end + inc; + self.tree[root].item.body = ty; + self.tree[root].item.end = self.tree[end].item.end; + self.tree[root].child = Some(start); + self.tree[root].next = None; + start = root; + } - fn parse_footnote_definition<'b>(&self, data: &'b str) -> Option<(&'b str, usize)> { - assert!(self.opts.contains(Options::ENABLE_FOOTNOTES)); - self.parse_footnote(data).and_then(|(name, len)| { - let n_colon = scan_ch(&data[len ..], b':'); - if n_colon == 0 { - None - } else { - let space = scan_whitespace_no_nl(&data[len + n_colon..]); - // skip newline if definition is on a line by itself, as likely that - // means the footnote definition is a complex block. - let mut i = len + n_colon + space; - if let (n, true) = scan_eol(&data[i..]) { - let (n_containers, _, _) = self.scan_containers(&data[i + n ..]); - i += n + n_containers; + // set next for top most emph level + prev_ix = el.start + el.count - match_count; + prev = Some(prev_ix); + cur = self.tree[cur_ix + match_count - 1].next; + self.tree[prev_ix].next = cur; + + if el.count > match_count { + self.inline_stack.push(InlineEl { + start: el.start, + count: el.count - match_count, + c: el.c, + both, + }) + } + count -= match_count; + if count > 0 { + cur_ix = cur.unwrap(); + } else { + break; + } + } + } + if count > 0 { + if can_open { + self.inline_stack.push(InlineEl { + start: cur_ix, + count, + c, + both, + }); + } else { + for i in 0..count { + self.tree[cur_ix + i].item.body = ItemBody::Text; + } + } + prev_ix = cur_ix + count - 1; + prev = Some(prev_ix); + cur = self.tree[prev_ix].next; + } + } + ItemBody::MaybeSmartQuote(c, can_open, can_close) => { + self.tree[cur_ix].item.body = match c { + b'\'' => { + if let (Some(open_ix), true) = (single_quote_open, can_close) { + self.tree[open_ix].item.body = ItemBody::SynthesizeChar('‘'); + single_quote_open = None; + } else if can_open { + single_quote_open = Some(cur_ix); + } + ItemBody::SynthesizeChar('’') + } + _ /* double quote */ => { + if can_close && double_quote_open { + double_quote_open = false; + ItemBody::SynthesizeChar('”') + } else { + if can_open && !double_quote_open { + double_quote_open = true; + } + ItemBody::SynthesizeChar('“') + } + } + }; + prev = cur; + cur = self.tree[cur_ix].next; + } + _ => { + prev = cur; + cur = self.tree[cur_ix].next; } - Some((name, i)) } - }) + } + self.inline_stack.pop_all(&mut self.tree); } - fn char_link_footnote(&mut self) -> Option> { - assert!(self.opts.contains(Options::ENABLE_FOOTNOTES)); - if let Some((name, end)) = self.parse_footnote(&self.text[self.off .. self.limit()]) { - self.off += end; - Some(Event::FootnoteReference(Cow::Borrowed(name))) + /// Returns next byte index, url and title. + fn scan_inline_link( + &self, + underlying: &'a str, + mut ix: usize, + node: Option, + ) -> Option<(usize, CowStr<'a>, CowStr<'a>)> { + if scan_ch(&underlying.as_bytes()[ix..], b'(') == 0 { + return None; + } + ix += 1; + ix += scan_while(&underlying.as_bytes()[ix..], is_ascii_whitespace); + + let (dest_length, dest) = scan_link_dest(underlying, ix, LINK_MAX_NESTED_PARENS)?; + let dest = unescape(dest); + ix += dest_length; + + ix += scan_while(&underlying.as_bytes()[ix..], is_ascii_whitespace); + + let title = if let Some((bytes_scanned, t)) = self.scan_link_title(underlying, ix, node) { + ix += bytes_scanned; + ix += scan_while(&underlying.as_bytes()[ix..], is_ascii_whitespace); + t } else { - self.char_link() + "".into() + }; + if scan_ch(&underlying.as_bytes()[ix..], b')') == 0 { + return None; } - } + ix += 1; - fn parse_footnote<'b>(&self, data: &'b str) -> Option<(&'b str, usize)> { - assert!(self.opts.contains(Options::ENABLE_FOOTNOTES)); - let (n_footnote, text_beg, text_end) = self.scan_footnote_label(data); - if n_footnote == 0 { return None; } - Some((&data[text_beg..text_end], n_footnote)) + Some((ix, dest, title)) } - fn scan_footnote_label(&self, data: &str) -> (usize, usize, usize) { - assert!(self.opts.contains(Options::ENABLE_FOOTNOTES)); - let mut i = scan_ch(data, b'['); - if i == 0 { return (0, 0, 0); } - if i >= data.len() || data.as_bytes()[i] != b'^' { return (0, 0, 0); } - i += 1; - let text_beg = i; - loop { - if i >= data.len() { return (0, 0, 0); } - match data.as_bytes()[i] { - b'\n' => { - let n = self.scan_whitespace_inline(&data[i..]); - if n == 0 { return (0, 0, 0); } + // returns (bytes scanned, title cow) + fn scan_link_title( + &self, + text: &'a str, + start_ix: usize, + node: Option, + ) -> Option<(usize, CowStr<'a>)> { + let bytes = text.as_bytes(); + let open = match bytes.get(start_ix) { + Some(b @ b'\'') | Some(b @ b'\"') | Some(b @ b'(') => *b, + _ => return None, + }; + let close = if open == b'(' { b')' } else { open }; + + let mut title = String::new(); + let mut mark = start_ix + 1; + let mut i = start_ix + 1; + + while i < bytes.len() { + let c = bytes[i]; + + if c == close { + let cow = if mark == 1 { + (i - start_ix + 1, text[mark..i].into()) + } else { + title.push_str(&text[mark..i]); + (i - start_ix + 1, title.into()) + }; + + return Some(cow); + } + if c == open { + return None; + } + + if c == b'\n' || c == b'\r' { + if let Some(node_ix) = scan_nodes_to_ix(&self.tree, node, i + 1) { + if self.tree[node_ix].item.start > i { + title.push_str(&text[mark..i]); + title.push('\n'); + i = self.tree[node_ix].item.start; + mark = i; + continue; + } + } + } + if c == b'&' { + if let (n, Some(value)) = scan_entity(&bytes[i..]) { + title.push_str(&text[mark..i]); + title.push_str(&value); i += n; + mark = i; continue; } - b']' => break, - b'\\' => i += 1, - _ => () } + if c == b'\\' && i + 1 < bytes.len() && is_ascii_punctuation(bytes[i + 1]) { + title.push_str(&text[mark..i]); + i += 1; + mark = i; + } + i += 1; } - let text_end = i; - i += 1; // skip closing ] - (i, text_beg, text_end) - } - - // # Autolinks and inline HTML - - fn char_lt(&mut self) -> Option> { - let tail = &self.text[self.off .. self.limit()]; - if let Some((n, link)) = scan_autolink(tail) { - let next = self.off + n; - self.off += 1; - self.state = State::Literal; - return Some(self.start(Tag::Link(link, Borrowed("")), next - 1, next)) - } - let n = self.scan_inline_html(tail); - if n != 0 { - return Some(self.inline_html_event(n)) - } + None } - fn scan_autolink_or_html(&self, data: &str) -> usize { - if let Some((n, _)) = scan_autolink(data) { - n - } else { - self.scan_inline_html(data) - } - } + /// Make a code span. + /// + /// Both `open` and `close` are matching MaybeCode items. + fn make_code_span(&mut self, open: TreeIndex, close: TreeIndex, preceding_backslash: bool) { + let first_ix = open + 1; + let last_ix = close - 1; + let bytes = self.text.as_bytes(); + let mut span_start = self.tree[open].item.end; + let mut span_end = self.tree[close].item.start; + let mut buf: Option = None; + + // detect all-space sequences, since they are kept as-is as of commonmark 0.29 + if !bytes[span_start..span_end].iter().all(|&b| b == b' ') { + let opening = match bytes[span_start] { + b' ' | b'\r' | b'\n' => true, + _ => false, + }; + let closing = match bytes[span_end - 1] { + b' ' | b'\r' | b'\n' => true, + _ => false, + }; + let drop_enclosing_whitespace = opening && closing; - fn scan_inline_html(&self, data: &str) -> usize { - let n = self.scan_html_tag(data); - if n != 0 { return n; } - let n = self.scan_html_comment(data); - if n != 0 { return n; } - let n = self.scan_processing_instruction(data); - if n != 0 { return n; } - let n = self.scan_declaration(data); - if n != 0 { return n; } - let n = self.scan_cdata(data); - if n != 0 { return n; } - 0 - } - - fn scan_html_tag(&self, data: &str) -> usize { - let size = data.len(); - let mut i = 0; - if scan_ch(data, b'<') == 0 { return 0; } - i += 1; - let n_slash = scan_ch(&data[i..], b'/'); - i += n_slash; - if i == size || !is_ascii_alpha(data.as_bytes()[i]) { return 0; } - i += 1; - i += scan_while(&data[i..], is_ascii_alphanumeric); - if n_slash == 0 { - loop { - let n = self.scan_whitespace_inline(&data[i..]); - if n == 0 { break; } - i += n; - let n = scan_attribute_name(&data[i..]); - if n == 0 { break; } - i += n; - let n = self.scan_whitespace_inline(&data[i..]); - if scan_ch(&data[i + n ..], b'=') != 0 { - i += n + 1; - i += self.scan_whitespace_inline(&data[i..]); - let n_attr = self.scan_attribute_value(&data[i..]); - if n_attr == 0 { return 0; } - i += n_attr; + if drop_enclosing_whitespace { + span_start += 1; + if span_start < span_end { + span_end -= 1; } } - i += self.scan_whitespace_inline(&data[i..]); - i += scan_ch(&data[i..], b'/'); - } else { - i += self.scan_whitespace_inline(&data[i..]); - } - if scan_ch(&data[i..], b'>') == 0 { return 0; } - i += 1; - i - } - fn scan_attribute_value(&self, data: &str) -> usize { - let size = data.len(); - if size == 0 { return 0; } - let open = data.as_bytes()[0]; - let quoted = open == b'\'' || open == b'"'; - let mut i = if quoted { 1 } else { 0 }; - while i < size { - let c = data.as_bytes()[i]; - match c { - b'\n' => { - if !quoted { break; } - let n = self.scan_whitespace_inline(&data[i..]); - if n == 0 { return 0; } - i += n; - } - b'\'' | b'"' | b'=' | b'<' | b'>' | b'`' | b'\t' ... b' ' => { - if !quoted || c == open { break; } - i += 1; + let mut ix = first_ix; + + while ix < close { + if let ItemBody::HardBreak | ItemBody::SoftBreak = self.tree[ix].item.body { + if drop_enclosing_whitespace { + // check whether break should be ignored + if ix == first_ix { + ix = ix + 1; + span_start = min(span_end, self.tree[ix].item.start); + continue; + } else if ix == last_ix && last_ix > first_ix { + ix = ix + 1; + continue; + } + } + + let end = bytes[self.tree[ix].item.start..] + .iter() + .position(|&b| b == b'\r' || b == b'\n') + .unwrap() + + self.tree[ix].item.start; + if let Some(ref mut buf) = buf { + buf.push_str(&self.text[self.tree[ix].item.start..end]); + buf.push(' '); + } else { + let mut new_buf = String::with_capacity(span_end - span_start); + new_buf.push_str(&self.text[span_start..end]); + new_buf.push(' '); + buf = Some(new_buf); + } + } else if let Some(ref mut buf) = buf { + let end = if ix == last_ix { + span_end + } else { + self.tree[ix].item.end + }; + buf.push_str(&self.text[self.tree[ix].item.start..end]); } - _ => i += 1 + ix = ix + 1; } } - if quoted { - if i == size || data.as_bytes()[i] != open { return 0; } - i += 1; + + let cow = if let Some(buf) = buf { + buf.into() + } else { + self.text[span_start..span_end].into() + }; + if preceding_backslash { + self.tree[open].item.body = ItemBody::Text; + self.tree[open].item.end = self.tree[open].item.start + 1; + self.tree[open].next = Some(close); + self.tree[close].item.body = ItemBody::Code(self.allocs.allocate_cow(cow)); + self.tree[close].item.start = self.tree[open].item.start + 1; + } else { + self.tree[open].item.body = ItemBody::Code(self.allocs.allocate_cow(cow)); + self.tree[open].item.end = self.tree[close].item.end; + self.tree[open].next = self.tree[close].next; } - i } - fn scan_html_comment(&self, data: &str) -> usize { - if !data.starts_with(""##; - use pulldown_cmark::{Parser, html}; - let mut s = String::new(); - - let p = Parser::new(&original); - html::push_html(&mut s, p); - + html::push_html(&mut s, Parser::new(&original)); assert_eq!(expected, s); } @@ -138,13 +120,8 @@

Useless

]]>"##; - use pulldown_cmark::{Parser, html}; - let mut s = String::new(); - - let p = Parser::new(&original); - html::push_html(&mut s, p); - + html::push_html(&mut s, Parser::new(&original)); assert_eq!(expected, s); } @@ -160,13 +137,8 @@ Some things are here... >"##; - use pulldown_cmark::{Parser, html}; - let mut s = String::new(); - - let p = Parser::new(&original); - html::push_html(&mut s, p); - + html::push_html(&mut s, Parser::new(&original)); assert_eq!(expected, s); } @@ -197,13 +169,53 @@ } "##; - use pulldown_cmark::{Parser, html}; + let mut s = String::new(); + html::push_html(&mut s, Parser::new(&original)); + assert_eq!(expected, s); +} + +#[test] +fn html_test_8() { + let original = "A | B\n---|---\nfoo | bar"; + let expected = r##" + +
AB
foobar
+"##; let mut s = String::new(); + let mut opts = Options::empty(); + opts.insert(Options::ENABLE_TABLES); + html::push_html(&mut s, Parser::new_ext(&original, opts)); + assert_eq!(expected, s); +} - let p = Parser::new(&original); - html::push_html(&mut s, p); +#[test] +fn html_test_9() { + let original = "---"; + let expected = "
\n"; + + let mut s = String::new(); + html::push_html(&mut s, Parser::new(&original)); + assert_eq!(expected, s); +} + +#[test] +fn html_test_10() { + let original = "* * *"; + let expected = "
\n"; + + let mut s = String::new(); + html::push_html(&mut s, Parser::new(&original)); + assert_eq!(expected, s); +} +#[test] +fn html_test_11() { + let original = "hi ~~no~~"; + let expected = "

hi ~~no~~

\n"; + + let mut s = String::new(); + html::push_html(&mut s, Parser::new(&original)); assert_eq!(expected, s); } @@ -221,19 +233,19 @@ baz,

"##; - use pulldown_cmark::{Options, Parser, html}; + use pulldown_cmark::{html, Options, Parser}; let mut s = String::new(); - let callback = |reference: &str, _normalized: &str| -> Option<(String, String)> { - if reference == "foo" || reference == "baz" { + let mut callback = |broken_link: BrokenLink| { + if broken_link.reference == "foo" || broken_link.reference == "baz" { Some(("https://replaced.example.org".into(), "some title".into())) } else { None } }; - let p = Parser::new_with_broken_link_callback(&original, Options::empty(), Some(&callback)); + let p = Parser::new_with_broken_link_callback(&original, Options::empty(), Some(&mut callback)); html::push_html(&mut s, p); assert_eq!(expected, s); diff -Nru rust-pulldown-cmark-0.2.0/tests/lib.rs rust-pulldown-cmark-0.8.0/tests/lib.rs --- rust-pulldown-cmark-0.2.0/tests/lib.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/lib.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,425 @@ +#[macro_use] +extern crate html5ever; +#[macro_use] +extern crate lazy_static; + +use html5ever::serialize::{serialize, SerializeOpts}; +use html5ever::{driver as html, QualName}; +use markup5ever_rcdom::{Handle, NodeData, RcDom, SerializableHandle}; +use pulldown_cmark::{Options, Parser}; + +use regex::Regex; +use std::collections::HashSet; +use std::mem; +use std::rc::{Rc, Weak}; +use tendril::stream::TendrilSink; + +mod suite; + +#[inline(never)] +pub fn test_markdown_html(input: &str, output: &str, smart_punct: bool) { + let mut s = String::new(); + + let mut opts = Options::empty(); + opts.insert(Options::ENABLE_TABLES); + opts.insert(Options::ENABLE_FOOTNOTES); + opts.insert(Options::ENABLE_STRIKETHROUGH); + opts.insert(Options::ENABLE_TASKLISTS); + if smart_punct { + opts.insert(Options::ENABLE_SMART_PUNCTUATION); + } + + let p = Parser::new_ext(input, opts); + pulldown_cmark::html::push_html(&mut s, p); + + assert_eq!(normalize_html(output), normalize_html(&s)); +} + +lazy_static! { + static ref WHITESPACE_RE: Regex = Regex::new(r"\s+").unwrap(); + static ref LEADING_WHITESPACE_RE: Regex = Regex::new(r"\A\s+").unwrap(); + static ref TRAILING_WHITESPACE_RE: Regex = Regex::new(r"\s+\z").unwrap(); + static ref BLOCK_TAGS: HashSet<&'static str> = [ + "article", + "header", + "aside", + "hgroup", + "blockquote", + "hr", + "iframe", + "body", + "li", + "map", + "button", + "object", + "canvas", + "ol", + "caption", + "output", + "col", + "p", + "colgroup", + "pre", + "dd", + "progress", + "div", + "section", + "dl", + "table", + "td", + "dt", + "tbody", + "embed", + "textarea", + "fieldset", + "tfoot", + "figcaption", + "th", + "figure", + "thead", + "footer", + "tr", + "form", + "ul", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "video", + "script", + "style" + ] + .iter() + .cloned() + .collect(); + static ref WHITESPACE_SENSITIVE_TAGS: HashSet<&'static str> = + ["pre", "code", "h1", "h2", "h3", "h4", "h5", "h6"] + .iter() + .cloned() + .collect(); + static ref TABLE_TAGS: HashSet<&'static str> = ["table", "thead", "tbody", "tr", "td"] + .iter() + .cloned() + .collect(); +} + +fn make_html_parser() -> html::Parser { + html::parse_fragment( + RcDom::default(), + html::ParseOpts::default(), + QualName::new(None, ns!(html), local_name!("div")), + vec![], + ) +} + +fn normalize_html(s: &str) -> String { + let parser = make_html_parser(); + let dom = parser.one(s); + let body: SerializableHandle = normalize_dom(&dom).into(); + let opts = SerializeOpts::default(); + let mut ret_val = Vec::new(); + serialize(&mut ret_val, &body, opts) + .expect("Writing to a string shouldn't fail (expect on OOM)"); + String::from_utf8(ret_val).expect("html5ever should always produce UTF8") +} + +fn normalize_dom(dom: &RcDom) -> Handle { + let body = { + let children = dom.document.children.borrow(); + children[0].clone() + }; + let mut current_level = Vec::new(); + let mut next_level = Vec::new(); + current_level.extend(body.children.borrow().iter().cloned().rev()); + loop { + while let Some(mut node) = current_level.pop() { + let parent = node.parent.replace(None); + node.parent.replace(parent.clone()); + let parent = parent + .expect("a node in the DOM will have a parent, except the root, which is not processed") + .upgrade().expect("a node's parent will be pointed to by its parent (or the root pointer), and will not be dropped"); + let retain = normalize_node(&parent, &mut node); + if !retain { + let mut siblings = parent.children.borrow_mut(); + siblings.retain(|s| !Rc::ptr_eq(&node, s)); + } else { + next_level.extend(node.children.borrow().iter().cloned().rev()); + } + } + if next_level.is_empty() { + break; + }; + mem::swap(&mut next_level, &mut current_level); + } + body +} + +// Returns false if node is an empty text node or an empty tbody. +// Returns true otherwise. +fn normalize_node(parent: &Handle, node: &mut Handle) -> bool { + match node.data { + NodeData::Comment { .. } + | NodeData::Doctype { .. } + | NodeData::Document + | NodeData::ProcessingInstruction { .. } => true, + NodeData::Text { ref contents, .. } => { + let mut contents = contents.borrow_mut(); + let is_pre = { + let mut parent = parent.clone(); + loop { + let is_pre = if let NodeData::Element { ref name, .. } = parent.data { + WHITESPACE_SENSITIVE_TAGS.contains(&&*name.local.to_ascii_lowercase()) + } else { + false + }; + if is_pre { + break true; + }; + let parent_ = parent.parent.replace(None); + parent.parent.replace(parent_.clone()); + let parent_ = parent_.as_ref().and_then(Weak::upgrade); + if let Some(parent_) = parent_ { + parent = parent_ + } else { + break false; + }; + } + }; + if !is_pre { + let (is_first_in_block, is_last_in_block) = { + let mut is_first_in_block = true; + let mut is_last_in_block = true; + let mut parent = parent.clone(); + let mut node = node.clone(); + loop { + let reached_block = if let NodeData::Element { ref name, .. } = parent.data + { + BLOCK_TAGS.contains(&&*name.local.to_ascii_lowercase()) + } else { + false + }; + let (is_first, is_last) = { + let siblings = parent.children.borrow(); + let n = &node; + ( + siblings.get(0).map(|s| Rc::ptr_eq(s, n)).unwrap_or(false), + siblings.len() > 0 + && siblings + .get(siblings.len() - 1) + .map(|s| Rc::ptr_eq(s, n)) + .unwrap_or(false), + ) + }; + is_first_in_block = is_first_in_block && is_first; + is_last_in_block = is_last_in_block && is_last; + if (is_first_in_block || is_last_in_block) && !reached_block { + node = parent.clone(); + let parent_ = parent.parent.replace(None); + parent.parent.replace(parent_.clone()); + let parent_ = parent_.as_ref().and_then(Weak::upgrade); + if let Some(parent_) = parent_ { + parent = parent_; + } else { + break (is_first_in_block, is_last_in_block); + } + } else { + break (is_first_in_block, is_last_in_block); + } + } + }; + let is_preceeded_by_ws = { + let mut parent = parent.clone(); + let mut node = node.clone(); + 'ascent: loop { + let is_first = { + let siblings = parent.children.borrow(); + let n = &node; + siblings.get(0).map(|s| Rc::ptr_eq(s, n)).unwrap_or(false) + }; + if is_first { + node = parent.clone(); + let parent_ = parent.parent.replace(None); + parent.parent.replace(parent_.clone()); + let parent_ = parent_.as_ref().and_then(Weak::upgrade); + if let Some(parent_) = parent_ { + parent = parent_; + } else { + break 'ascent false; + } + } else { + let siblings = parent.children.borrow(); + let n = &node; + let mut pos = !0; + 'search: for (i, s) in siblings.iter().enumerate() { + if Rc::ptr_eq(s, n) { + pos = i; + break 'search; + } + } + assert!( + pos != !0, + "The list of node's parent's children shall contain node" + ); + assert!( + pos != 0, + "If node is not first, then node's position shall not be zero" + ); + let mut preceeding = siblings[pos - 1].clone(); + 'descent: loop { + if let NodeData::Text { .. } = preceeding.data { + break 'descent; + } + preceeding = { + let ch = preceeding.children.borrow(); + if ch.len() == 0 { + break 'descent; + } + if let Some(preceeding_) = ch.get(ch.len() - 1) { + preceeding_.clone() + } else { + break 'descent; + } + }; + } + if let NodeData::Text { ref contents, .. } = preceeding.data { + break 'ascent TRAILING_WHITESPACE_RE.is_match(&*contents.borrow()); + } else { + break 'ascent false; + } + } + } + }; + + let is_in_table = if let NodeData::Element { ref name, .. } = parent.data { + TABLE_TAGS.contains(&&*name.local.to_ascii_lowercase()) + } else { + false + }; + let whitespace_replacement = if is_in_table { "" } else { " " }; + *contents = WHITESPACE_RE + .replace_all(&*contents, whitespace_replacement) + .as_ref() + .into(); + + if is_first_in_block || is_preceeded_by_ws { + *contents = LEADING_WHITESPACE_RE + .replace_all(&*contents, "") + .as_ref() + .into(); + } + if is_last_in_block { + *contents = TRAILING_WHITESPACE_RE + .replace_all(&*contents, "") + .as_ref() + .into(); + } + // TODO: collapse whitespace when adjacent to whitespace. + // For example, the whitespace in the span should be collapsed in all of these cases: + // + // " q " + // "q q" + // "q q" + // "q q" + // "q q" + } + &**contents != "" + } + NodeData::Element { + ref attrs, + ref name, + .. + } => { + let mut attrs = attrs.borrow_mut(); + for a in attrs.iter_mut() { + a.name.local = a.name.local.to_ascii_lowercase().into(); + } + attrs.sort_by(|a: &html5ever::Attribute, b: &html5ever::Attribute| { + (&*a.name.local).cmp(&*b.name.local) + }); + let ascii_name = &*name.local.to_ascii_lowercase(); + // drop empty tbody's + ascii_name != "tbody" + || node.children.borrow().len() > 1 + || node + .children + .borrow() + .iter() + .next() + .map(|only_child| match only_child.data { + NodeData::Text { ref contents, .. } => { + !contents.borrow().chars().all(|c| c.is_whitespace()) + } + _ => true, + }) + .unwrap_or(false) + } + } +} + +#[test] +fn strip_div_newline() { + assert_eq!("
", normalize_html("
\n
")); +} + +#[test] +fn strip_end_newline() { + assert_eq!("test", normalize_html("test\n")); +} + +#[test] +fn strip_double_space() { + assert_eq!("test mess", normalize_html("test mess")); +} + +#[test] +fn strip_inline_internal_text() { + assert_eq!( + "a b c", + normalize_html(" a b c ") + ) +} + +#[test] +fn strip_inline_block_internal_text() { + assert_eq!( + "a b c", + normalize_html(" a b c ") + ) +} + +#[test] +fn leaves_necessary_whitespace_alone() { + assert_eq!("a b c", normalize_html("a b c")) +} + +#[test] +fn leaves_necessary_whitespace_alone_weird() { + assert_eq!( + "a b c", + normalize_html(" a b c") + ) +} + +#[test] +fn leaves_necessary_whitespace_all_nested() { + assert_eq!( + "", + normalize_html(" ") + ) +} + +#[test] +fn drops_empty_tbody() { + assert_eq!( + "
hi
", + normalize_html("
hi
") + ) +} + +#[test] +fn leaves_nonempty_tbody() { + let input = "
hi
"; + assert_eq!(input, normalize_html(input)) +} diff -Nru rust-pulldown-cmark-0.2.0/tests/spec.rs rust-pulldown-cmark-0.8.0/tests/spec.rs --- rust-pulldown-cmark-0.2.0/tests/spec.rs 2018-11-07 16:24:27.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/spec.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,15223 +0,0 @@ -// This file is auto-generated by the build script -// Please, do not modify it manually - -extern crate pulldown_cmark; - - - #[test] - fn spec_test_1() { - let original = r##" foo baz bim -"##; - let expected = r##"
foo	baz		bim
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_2() { - let original = r##" foo baz bim -"##; - let expected = r##"
foo	baz		bim
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_3() { - let original = r##" a a - ὐ a -"##; - let expected = r##"
a	a
-ὐ	a
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_4() { - let original = r##" - foo - - bar -"##; - let expected = r##"
    -
  • -

    foo

    -

    bar

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_5() { - let original = r##"- foo - - bar -"##; - let expected = r##"
    -
  • -

    foo

    -
      bar
    -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_6() { - let original = r##"> foo -"##; - let expected = r##"
-
  foo
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_7() { - let original = r##"- foo -"##; - let expected = r##"
    -
  • -
      foo
    -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_8() { - let original = r##" foo - bar -"##; - let expected = r##"
foo
-bar
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_9() { - let original = r##" - foo - - bar - - baz -"##; - let expected = r##"
    -
  • foo -
      -
    • bar -
        -
      • baz
      • -
      -
    • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_10() { - let original = r##"# Foo -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_11() { - let original = r##"* * * -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_12() { - let original = r##"- `one -- two` -"##; - let expected = r##"
    -
  • `one
  • -
  • two`
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_13() { - let original = r##"*** ---- -___ -"##; - let expected = r##"
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_14() { - let original = r##"+++ -"##; - let expected = r##"

+++

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_15() { - let original = r##"=== -"##; - let expected = r##"

===

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_16() { - let original = r##"-- -** -__ -"##; - let expected = r##"

-- -** -__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_17() { - let original = r##" *** - *** - *** -"##; - let expected = r##"
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_18() { - let original = r##" *** -"##; - let expected = r##"
***
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_19() { - let original = r##"Foo - *** -"##; - let expected = r##"

Foo -***

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_20() { - let original = r##"_____________________________________ -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_21() { - let original = r##" - - - -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_22() { - let original = r##" ** * ** * ** * ** -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_23() { - let original = r##"- - - - -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_24() { - let original = r##"- - - - -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_25() { - let original = r##"_ _ _ _ a - -a------ - ----a--- -"##; - let expected = r##"

_ _ _ _ a

-

a------

-

---a---

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_26() { - let original = r##" *-* -"##; - let expected = r##"

-

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_27() { - let original = r##"- foo -*** -- bar -"##; - let expected = r##"
    -
  • foo
  • -
-
-
    -
  • bar
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_28() { - let original = r##"Foo -*** -bar -"##; - let expected = r##"

Foo

-
-

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_29() { - let original = r##"Foo ---- -bar -"##; - let expected = r##"

Foo

-

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_30() { - let original = r##"* Foo -* * * -* Bar -"##; - let expected = r##"
    -
  • Foo
  • -
-
-
    -
  • Bar
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_31() { - let original = r##"- Foo -- * * * -"##; - let expected = r##"
    -
  • Foo
  • -
  • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_32() { - let original = r##"# foo -## foo -### foo -#### foo -##### foo -###### foo -"##; - let expected = r##"

foo

-

foo

-

foo

-

foo

-
foo
-
foo
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_33() { - let original = r##"####### foo -"##; - let expected = r##"

####### foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_34() { - let original = r##"#5 bolt - -#hashtag -"##; - let expected = r##"

#5 bolt

-

#hashtag

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_35() { - let original = r##"\## foo -"##; - let expected = r##"

## foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_36() { - let original = r##"# foo *bar* \*baz\* -"##; - let expected = r##"

foo bar *baz*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_37() { - let original = r##"# foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_38() { - let original = r##" ### foo - ## foo - # foo -"##; - let expected = r##"

foo

-

foo

-

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_39() { - let original = r##" # foo -"##; - let expected = r##"
# foo
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_40() { - let original = r##"foo - # bar -"##; - let expected = r##"

foo -# bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_41() { - let original = r##"## foo ## - ### bar ### -"##; - let expected = r##"

foo

-

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_42() { - let original = r##"# foo ################################## -##### foo ## -"##; - let expected = r##"

foo

-
foo
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_43() { - let original = r##"### foo ### -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_44() { - let original = r##"### foo ### b -"##; - let expected = r##"

foo ### b

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_45() { - let original = r##"# foo# -"##; - let expected = r##"

foo#

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_46() { - let original = r##"### foo \### -## foo #\## -# foo \# -"##; - let expected = r##"

foo ###

-

foo ###

-

foo #

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_47() { - let original = r##"**** -## foo -**** -"##; - let expected = r##"
-

foo

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_48() { - let original = r##"Foo bar -# baz -Bar foo -"##; - let expected = r##"

Foo bar

-

baz

-

Bar foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_49() { - let original = r##"## -# -### ### -"##; - let expected = r##"

-

-

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_50() { - let original = r##"Foo *bar* -========= - -Foo *bar* ---------- -"##; - let expected = r##"

Foo bar

-

Foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_51() { - let original = r##"Foo *bar -baz* -==== -"##; - let expected = r##"

Foo bar -baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_52() { - let original = r##"Foo -------------------------- - -Foo -= -"##; - let expected = r##"

Foo

-

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_53() { - let original = r##" Foo ---- - - Foo ------ - - Foo - === -"##; - let expected = r##"

Foo

-

Foo

-

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_54() { - let original = r##" Foo - --- - - Foo ---- -"##; - let expected = r##"
Foo
----
-
-Foo
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_55() { - let original = r##"Foo - ---- -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_56() { - let original = r##"Foo - --- -"##; - let expected = r##"

Foo ----

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_57() { - let original = r##"Foo -= = - -Foo ---- - -"##; - let expected = r##"

Foo -= =

-

Foo

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_58() { - let original = r##"Foo ------ -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_59() { - let original = r##"Foo\ ----- -"##; - let expected = r##"

Foo\

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_60() { - let original = r##"`Foo ----- -` - - -"##; - let expected = r##"

`Foo

-

`

-

<a title="a lot

-

of dashes"/>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_61() { - let original = r##"> Foo ---- -"##; - let expected = r##"
-

Foo

-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_62() { - let original = r##"> foo -bar -=== -"##; - let expected = r##"
-

foo -bar -===

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_63() { - let original = r##"- Foo ---- -"##; - let expected = r##"
    -
  • Foo
  • -
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_64() { - let original = r##"Foo -Bar ---- -"##; - let expected = r##"

Foo -Bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_65() { - let original = r##"--- -Foo ---- -Bar ---- -Baz -"##; - let expected = r##"
-

Foo

-

Bar

-

Baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_66() { - let original = r##" -==== -"##; - let expected = r##"

====

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_67() { - let original = r##"--- ---- -"##; - let expected = r##"
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_68() { - let original = r##"- foo ------ -"##; - let expected = r##"
    -
  • foo
  • -
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_69() { - let original = r##" foo ---- -"##; - let expected = r##"
foo
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_70() { - let original = r##"> foo ------ -"##; - let expected = r##"
-

foo

-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_71() { - let original = r##"\> foo ------- -"##; - let expected = r##"

> foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_72() { - let original = r##"Foo - -bar ---- -baz -"##; - let expected = r##"

Foo

-

bar

-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_73() { - let original = r##"Foo -bar - ---- - -baz -"##; - let expected = r##"

Foo -bar

-
-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_74() { - let original = r##"Foo -bar -* * * -baz -"##; - let expected = r##"

Foo -bar

-
-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_75() { - let original = r##"Foo -bar -\--- -baz -"##; - let expected = r##"

Foo -bar ---- -baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_76() { - let original = r##" a simple - indented code block -"##; - let expected = r##"
a simple
-  indented code block
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_77() { - let original = r##" - foo - - bar -"##; - let expected = r##"
    -
  • -

    foo

    -

    bar

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_78() { - let original = r##"1. foo - - - bar -"##; - let expected = r##"
    -
  1. -

    foo

    -
      -
    • bar
    • -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_79() { - let original = r##"
- *hi* - - - one -"##; - let expected = r##"
<a/>
-*hi*
-
-- one
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_80() { - let original = r##" chunk1 - - chunk2 - - - - chunk3 -"##; - let expected = r##"
chunk1
-
-chunk2
-
-
-
-chunk3
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_81() { - let original = r##" chunk1 - - chunk2 -"##; - let expected = r##"
chunk1
-  
-  chunk2
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_82() { - let original = r##"Foo - bar - -"##; - let expected = r##"

Foo -bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_83() { - let original = r##" foo -bar -"##; - let expected = r##"
foo
-
-

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_84() { - let original = r##"# Heading - foo -Heading ------- - foo ----- -"##; - let expected = r##"

Heading

-
foo
-
-

Heading

-
foo
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_85() { - let original = r##" foo - bar -"##; - let expected = r##"
    foo
-bar
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_86() { - let original = r##" - - foo - - -"##; - let expected = r##"
foo
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_87() { - let original = r##" foo -"##; - let expected = r##"
foo  
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_88() { - let original = r##"``` -< - > -``` -"##; - let expected = r##"
<
- >
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_89() { - let original = r##"~~~ -< - > -~~~ -"##; - let expected = r##"
<
- >
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_90() { - let original = r##"`` -foo -`` -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_91() { - let original = r##"``` -aaa -~~~ -``` -"##; - let expected = r##"
aaa
-~~~
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_92() { - let original = r##"~~~ -aaa -``` -~~~ -"##; - let expected = r##"
aaa
-```
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_93() { - let original = r##"```` -aaa -``` -`````` -"##; - let expected = r##"
aaa
-```
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_94() { - let original = r##"~~~~ -aaa -~~~ -~~~~ -"##; - let expected = r##"
aaa
-~~~
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_95() { - let original = r##"``` -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_96() { - let original = r##"````` - -``` -aaa -"##; - let expected = r##"

-```
-aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_97() { - let original = r##"> ``` -> aaa - -bbb -"##; - let expected = r##"
-
aaa
-
-
-

bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_98() { - let original = r##"``` - - -``` -"##; - let expected = r##"

-  
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_99() { - let original = r##"``` -``` -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_100() { - let original = r##" ``` - aaa -aaa -``` -"##; - let expected = r##"
aaa
-aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_101() { - let original = r##" ``` -aaa - aaa -aaa - ``` -"##; - let expected = r##"
aaa
-aaa
-aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_102() { - let original = r##" ``` - aaa - aaa - aaa - ``` -"##; - let expected = r##"
aaa
- aaa
-aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_103() { - let original = r##" ``` - aaa - ``` -"##; - let expected = r##"
```
-aaa
-```
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_104() { - let original = r##"``` -aaa - ``` -"##; - let expected = r##"
aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_105() { - let original = r##" ``` -aaa - ``` -"##; - let expected = r##"
aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_106() { - let original = r##"``` -aaa - ``` -"##; - let expected = r##"
aaa
-    ```
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_107() { - let original = r##"``` ``` -aaa -"##; - let expected = r##"

-aaa

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_108() { - let original = r##"~~~~~~ -aaa -~~~ ~~ -"##; - let expected = r##"
aaa
-~~~ ~~
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_109() { - let original = r##"foo -``` -bar -``` -baz -"##; - let expected = r##"

foo

-
bar
-
-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_110() { - let original = r##"foo ---- -~~~ -bar -~~~ -# baz -"##; - let expected = r##"

foo

-
bar
-
-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_111() { - let original = r##"```ruby -def foo(x) - return 3 -end -``` -"##; - let expected = r##"
def foo(x)
-  return 3
-end
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_112() { - let original = r##"~~~~ ruby startline=3 $%@#$ -def foo(x) - return 3 -end -~~~~~~~ -"##; - let expected = r##"
def foo(x)
-  return 3
-end
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_113() { - let original = r##"````; -```` -"##; - let expected = r##"
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_114() { - let original = r##"``` aa ``` -foo -"##; - let expected = r##"

aa -foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_115() { - let original = r##"~~~ aa ``` ~~~ -foo -~~~ -"##; - let expected = r##"
foo
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_116() { - let original = r##"``` -``` aaa -``` -"##; - let expected = r##"
``` aaa
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_117() { - let original = r##"
-
-**Hello**,
-
-_world_.
-
-
-"##; - let expected = r##"
-
-**Hello**,
-

world. -

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_118() { - let original = r##" - - - -
- hi -
- -okay. -"##; - let expected = r##" - - - -
- hi -
-

okay.

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_119() { - let original = r##"
-*foo* -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_121() { - let original = r##"
- -*Markdown* - -
-"##; - let expected = r##"
-

Markdown

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_122() { - let original = r##"
-
-"##; - let expected = r##"
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_123() { - let original = r##"
-
-"##; - let expected = r##"
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_124() { - let original = r##"
-*foo* - -*bar* -"##; - let expected = r##"
-*foo* -

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_125() { - let original = r##"
-"##; - let expected = r##" -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_129() { - let original = r##"
-foo -
-"##; - let expected = r##"
-foo -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_130() { - let original = r##"
-``` c -int x = 33; -``` -"##; - let expected = r##"
-``` c -int x = 33; -``` -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_131() { - let original = r##" -*bar* - -"##; - let expected = r##" -*bar* - -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_132() { - let original = r##" -*bar* - -"##; - let expected = r##" -*bar* - -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_133() { - let original = r##" -*bar* - -"##; - let expected = r##" -*bar* - -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_134() { - let original = r##" -*bar* -"##; - let expected = r##" -*bar* -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_135() { - let original = r##" -*foo* - -"##; - let expected = r##" -*foo* - -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_136() { - let original = r##" - -*foo* - - -"##; - let expected = r##" -

foo

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_137() { - let original = r##"*foo* -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_138() { - let original = r##"

-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-
-okay -"##; - let expected = r##"

-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-
-

okay

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_139() { - let original = r##" -okay -"##; - let expected = r##" -

okay

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_140() { - let original = r##" -okay -"##; - let expected = r##" -

okay

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_141() { - let original = r##" -*foo* -"##; - let expected = r##" -

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_145() { - let original = r##"*bar* -*baz* -"##; - let expected = r##"*bar* -

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_146() { - let original = r##"1. *bar* -"##; - let expected = r##"1. *bar* -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_147() { - let original = r##" -okay -"##; - let expected = r##" -

okay

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_148() { - let original = r##"'; - -?> -okay -"##; - let expected = r##"'; - -?> -

okay

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_149() { - let original = r##" -"##; - let expected = r##" -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_150() { - let original = r##" -okay -"##; - let expected = r##" -

okay

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_151() { - let original = r##" - - -"##; - let expected = r##" -
<!-- foo -->
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_152() { - let original = r##"
- -
-"##; - let expected = r##"
-
<div>
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_153() { - let original = r##"Foo -
-bar -
-"##; - let expected = r##"

Foo

-
-bar -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_154() { - let original = r##"
-bar -
-*foo* -"##; - let expected = r##"
-bar -
-*foo* -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_155() { - let original = r##"Foo - -baz -"##; - let expected = r##"

Foo - -baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_156() { - let original = r##"
- -*Emphasized* text. - -
-"##; - let expected = r##"
-

Emphasized text.

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_157() { - let original = r##"
-*Emphasized* text. -
-"##; - let expected = r##"
-*Emphasized* text. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_158() { - let original = r##" - - - - - - - -
-Hi -
-"##; - let expected = r##" - - - -
-Hi -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_159() { - let original = r##" - - - - - - - -
- Hi -
-"##; - let expected = r##" - -
<td>
-  Hi
-</td>
-
- -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_160() { - let original = r##"[foo]: /url "title" - -[foo] -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_161() { - let original = r##" [foo]: - /url - 'the title' - -[foo] -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_162() { - let original = r##"[Foo*bar\]]:my_(url) 'title (with parens)' - -[Foo*bar\]] -"##; - let expected = r##"

Foo*bar]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_163() { - let original = r##"[Foo bar]: - -'title' - -[Foo bar] -"##; - let expected = r##"

Foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_164() { - let original = r##"[foo]: /url ' -title -line1 -line2 -' - -[foo] -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_165() { - let original = r##"[foo]: /url 'title - -with blank line' - -[foo] -"##; - let expected = r##"

[foo]: /url 'title

-

with blank line'

-

[foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_166() { - let original = r##"[foo]: -/url - -[foo] -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_167() { - let original = r##"[foo]: - -[foo] -"##; - let expected = r##"

[foo]:

-

[foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_168() { - let original = r##"[foo]: (baz) - -[foo] -"##; - let expected = r##"

[foo]: (baz)

-

[foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_169() { - let original = r##"[foo]: /url\bar\*baz "foo\"bar\baz" - -[foo] -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_170() { - let original = r##"[foo] - -[foo]: url -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_171() { - let original = r##"[foo] - -[foo]: first -[foo]: second -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_172() { - let original = r##"[FOO]: /url - -[Foo] -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_173() { - let original = r##"[ΑΓΩ]: /φου - -[αγω] -"##; - let expected = r##"

αγω

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_174() { - let original = r##"[foo]: /url -"##; - let expected = r##""##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_175() { - let original = r##"[ -foo -]: /url -bar -"##; - let expected = r##"

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_176() { - let original = r##"[foo]: /url "title" ok -"##; - let expected = r##"

[foo]: /url "title" ok

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_177() { - let original = r##"[foo]: /url -"title" ok -"##; - let expected = r##"

"title" ok

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_178() { - let original = r##" [foo]: /url "title" - -[foo] -"##; - let expected = r##"
[foo]: /url "title"
-
-

[foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_179() { - let original = r##"``` -[foo]: /url -``` - -[foo] -"##; - let expected = r##"
[foo]: /url
-
-

[foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_180() { - let original = r##"Foo -[bar]: /baz - -[bar] -"##; - let expected = r##"

Foo -[bar]: /baz

-

[bar]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_181() { - let original = r##"# [Foo] -[foo]: /url -> bar -"##; - let expected = r##"

Foo

-
-

bar

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_182() { - let original = r##"[foo]: /foo-url "foo" -[bar]: /bar-url - "bar" -[baz]: /baz-url - -[foo], -[bar], -[baz] -"##; - let expected = r##"

foo, -bar, -baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_183() { - let original = r##"[foo] - -> [foo]: /url -"##; - let expected = r##"

foo

-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_184() { - let original = r##"aaa - -bbb -"##; - let expected = r##"

aaa

-

bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_185() { - let original = r##"aaa -bbb - -ccc -ddd -"##; - let expected = r##"

aaa -bbb

-

ccc -ddd

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_186() { - let original = r##"aaa - - -bbb -"##; - let expected = r##"

aaa

-

bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_187() { - let original = r##" aaa - bbb -"##; - let expected = r##"

aaa -bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_188() { - let original = r##"aaa - bbb - ccc -"##; - let expected = r##"

aaa -bbb -ccc

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_189() { - let original = r##" aaa -bbb -"##; - let expected = r##"

aaa -bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_190() { - let original = r##" aaa -bbb -"##; - let expected = r##"
aaa
-
-

bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_191() { - let original = r##"aaa -bbb -"##; - let expected = r##"

aaa
-bbb

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_192() { - let original = r##" - -aaa - - -# aaa - - -"##; - let expected = r##"

aaa

-

aaa

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_193() { - let original = r##"> # Foo -> bar -> baz -"##; - let expected = r##"
-

Foo

-

bar -baz

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_194() { - let original = r##"># Foo ->bar -> baz -"##; - let expected = r##"
-

Foo

-

bar -baz

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_195() { - let original = r##" > # Foo - > bar - > baz -"##; - let expected = r##"
-

Foo

-

bar -baz

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_196() { - let original = r##" > # Foo - > bar - > baz -"##; - let expected = r##"
> # Foo
-> bar
-> baz
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_197() { - let original = r##"> # Foo -> bar -baz -"##; - let expected = r##"
-

Foo

-

bar -baz

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_198() { - let original = r##"> bar -baz -> foo -"##; - let expected = r##"
-

bar -baz -foo

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_199() { - let original = r##"> foo ---- -"##; - let expected = r##"
-

foo

-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_200() { - let original = r##"> - foo -- bar -"##; - let expected = r##"
-
    -
  • foo
  • -
-
-
    -
  • bar
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_201() { - let original = r##"> foo - bar -"##; - let expected = r##"
-
foo
-
-
-
bar
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_202() { - let original = r##"> ``` -foo -``` -"##; - let expected = r##"
-
-
-

foo

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_203() { - let original = r##"> foo - - bar -"##; - let expected = r##"
-

foo -- bar

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_204() { - let original = r##"> -"##; - let expected = r##"
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_205() { - let original = r##"> -> -> -"##; - let expected = r##"
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_206() { - let original = r##"> -> foo -> -"##; - let expected = r##"
-

foo

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_207() { - let original = r##"> foo - -> bar -"##; - let expected = r##"
-

foo

-
-
-

bar

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_208() { - let original = r##"> foo -> bar -"##; - let expected = r##"
-

foo -bar

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_209() { - let original = r##"> foo -> -> bar -"##; - let expected = r##"
-

foo

-

bar

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_210() { - let original = r##"foo -> bar -"##; - let expected = r##"

foo

-
-

bar

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_211() { - let original = r##"> aaa -*** -> bbb -"##; - let expected = r##"
-

aaa

-
-
-
-

bbb

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_212() { - let original = r##"> bar -baz -"##; - let expected = r##"
-

bar -baz

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_213() { - let original = r##"> bar - -baz -"##; - let expected = r##"
-

bar

-
-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_214() { - let original = r##"> bar -> -baz -"##; - let expected = r##"
-

bar

-
-

baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_215() { - let original = r##"> > > foo -bar -"##; - let expected = r##"
-
-
-

foo -bar

-
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_216() { - let original = r##">>> foo -> bar ->>baz -"##; - let expected = r##"
-
-
-

foo -bar -baz

-
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_217() { - let original = r##"> code - -> not code -"##; - let expected = r##"
-
code
-
-
-
-

not code

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_218() { - let original = r##"A paragraph -with two lines. - - indented code - -> A block quote. -"##; - let expected = r##"

A paragraph -with two lines.

-
indented code
-
-
-

A block quote.

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_219() { - let original = r##"1. A paragraph - with two lines. - - indented code - - > A block quote. -"##; - let expected = r##"
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_220() { - let original = r##"- one - - two -"##; - let expected = r##"
    -
  • one
  • -
-

two

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_221() { - let original = r##"- one - - two -"##; - let expected = r##"
    -
  • -

    one

    -

    two

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_222() { - let original = r##" - one - - two -"##; - let expected = r##"
    -
  • one
  • -
-
 two
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_223() { - let original = r##" - one - - two -"##; - let expected = r##"
    -
  • -

    one

    -

    two

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_224() { - let original = r##" > > 1. one ->> ->> two -"##; - let expected = r##"
-
-
    -
  1. -

    one

    -

    two

    -
  2. -
-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_225() { - let original = r##">>- one ->> - > > two -"##; - let expected = r##"
-
-
    -
  • one
  • -
-

two

-
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_226() { - let original = r##"-one - -2.two -"##; - let expected = r##"

-one

-

2.two

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_227() { - let original = r##"- foo - - - bar -"##; - let expected = r##"
    -
  • -

    foo

    -

    bar

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_228() { - let original = r##"1. foo - - ``` - bar - ``` - - baz - - > bam -"##; - let expected = r##"
    -
  1. -

    foo

    -
    bar
    -
    -

    baz

    -
    -

    bam

    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_229() { - let original = r##"- Foo - - bar - - - baz -"##; - let expected = r##"
    -
  • -

    Foo

    -
    bar
    -
    -
    -baz
    -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_230() { - let original = r##"123456789. ok -"##; - let expected = r##"
    -
  1. ok
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_231() { - let original = r##"1234567890. not ok -"##; - let expected = r##"

1234567890. not ok

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_232() { - let original = r##"0. ok -"##; - let expected = r##"
    -
  1. ok
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_233() { - let original = r##"003. ok -"##; - let expected = r##"
    -
  1. ok
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_234() { - let original = r##"-1. not ok -"##; - let expected = r##"

-1. not ok

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_235() { - let original = r##"- foo - - bar -"##; - let expected = r##"
    -
  • -

    foo

    -
    bar
    -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_236() { - let original = r##" 10. foo - - bar -"##; - let expected = r##"
    -
  1. -

    foo

    -
    bar
    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_237() { - let original = r##" indented code - -paragraph - - more code -"##; - let expected = r##"
indented code
-
-

paragraph

-
more code
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_238() { - let original = r##"1. indented code - - paragraph - - more code -"##; - let expected = r##"
    -
  1. -
    indented code
    -
    -

    paragraph

    -
    more code
    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_239() { - let original = r##"1. indented code - - paragraph - - more code -"##; - let expected = r##"
    -
  1. -
     indented code
    -
    -

    paragraph

    -
    more code
    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_240() { - let original = r##" foo - -bar -"##; - let expected = r##"

foo

-

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_241() { - let original = r##"- foo - - bar -"##; - let expected = r##"
    -
  • foo
  • -
-

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_242() { - let original = r##"- foo - - bar -"##; - let expected = r##"
    -
  • -

    foo

    -

    bar

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_243() { - let original = r##"- - foo -- - ``` - bar - ``` -- - baz -"##; - let expected = r##"
    -
  • foo
  • -
  • -
    bar
    -
    -
  • -
  • -
    baz
    -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_244() { - let original = r##"- - foo -"##; - let expected = r##"
    -
  • foo
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_245() { - let original = r##"- - - foo -"##; - let expected = r##"
    -
  • -
-

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_246() { - let original = r##"- foo -- -- bar -"##; - let expected = r##"
    -
  • foo
  • -
  • -
  • bar
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_247() { - let original = r##"- foo -- -- bar -"##; - let expected = r##"
    -
  • foo
  • -
  • -
  • bar
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_248() { - let original = r##"1. foo -2. -3. bar -"##; - let expected = r##"
    -
  1. foo
  2. -
  3. -
  4. bar
  5. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_249() { - let original = r##"* -"##; - let expected = r##"
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_250() { - let original = r##"foo -* - -foo -1. -"##; - let expected = r##"

foo -*

-

foo -1.

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_251() { - let original = r##" 1. A paragraph - with two lines. - - indented code - - > A block quote. -"##; - let expected = r##"
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_252() { - let original = r##" 1. A paragraph - with two lines. - - indented code - - > A block quote. -"##; - let expected = r##"
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_253() { - let original = r##" 1. A paragraph - with two lines. - - indented code - - > A block quote. -"##; - let expected = r##"
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_254() { - let original = r##" 1. A paragraph - with two lines. - - indented code - - > A block quote. -"##; - let expected = r##"
1.  A paragraph
-    with two lines.
-
-        indented code
-
-    > A block quote.
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_255() { - let original = r##" 1. A paragraph -with two lines. - - indented code - - > A block quote. -"##; - let expected = r##"
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_256() { - let original = r##" 1. A paragraph - with two lines. -"##; - let expected = r##"
    -
  1. A paragraph -with two lines.
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_257() { - let original = r##"> 1. > Blockquote -continued here. -"##; - let expected = r##"
-
    -
  1. -
    -

    Blockquote -continued here.

    -
    -
  2. -
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_258() { - let original = r##"> 1. > Blockquote -> continued here. -"##; - let expected = r##"
-
    -
  1. -
    -

    Blockquote -continued here.

    -
    -
  2. -
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_259() { - let original = r##"- foo - - bar - - baz - - boo -"##; - let expected = r##"
    -
  • foo -
      -
    • bar -
        -
      • baz -
          -
        • boo
        • -
        -
      • -
      -
    • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_260() { - let original = r##"- foo - - bar - - baz - - boo -"##; - let expected = r##"
    -
  • foo
  • -
  • bar
  • -
  • baz
  • -
  • boo
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_261() { - let original = r##"10) foo - - bar -"##; - let expected = r##"
    -
  1. foo -
      -
    • bar
    • -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_262() { - let original = r##"10) foo - - bar -"##; - let expected = r##"
    -
  1. foo
  2. -
-
    -
  • bar
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_263() { - let original = r##"- - foo -"##; - let expected = r##"
    -
  • -
      -
    • foo
    • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_264() { - let original = r##"1. - 2. foo -"##; - let expected = r##"
    -
  1. -
      -
    • -
        -
      1. foo
      2. -
      -
    • -
    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_265() { - let original = r##"- # Foo -- Bar - --- - baz -"##; - let expected = r##"
    -
  • -

    Foo

    -
  • -
  • -

    Bar

    -baz
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_266() { - let original = r##"- foo -- bar -+ baz -"##; - let expected = r##"
    -
  • foo
  • -
  • bar
  • -
-
    -
  • baz
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_267() { - let original = r##"1. foo -2. bar -3) baz -"##; - let expected = r##"
    -
  1. foo
  2. -
  3. bar
  4. -
-
    -
  1. baz
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_268() { - let original = r##"Foo -- bar -- baz -"##; - let expected = r##"

Foo

-
    -
  • bar
  • -
  • baz
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_269() { - let original = r##"The number of windows in my house is -14. The number of doors is 6. -"##; - let expected = r##"

The number of windows in my house is -14. The number of doors is 6.

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_270() { - let original = r##"The number of windows in my house is -1. The number of doors is 6. -"##; - let expected = r##"

The number of windows in my house is

-
    -
  1. The number of doors is 6.
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_271() { - let original = r##"- foo - -- bar - - -- baz -"##; - let expected = r##"
    -
  • -

    foo

    -
  • -
  • -

    bar

    -
  • -
  • -

    baz

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_272() { - let original = r##"- foo - - bar - - baz - - - bim -"##; - let expected = r##"
    -
  • foo -
      -
    • bar -
        -
      • -

        baz

        -

        bim

        -
      • -
      -
    • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_273() { - let original = r##"- foo -- bar - - - -- baz -- bim -"##; - let expected = r##"
    -
  • foo
  • -
  • bar
  • -
- -
    -
  • baz
  • -
  • bim
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_274() { - let original = r##"- foo - - notcode - -- foo - - - - code -"##; - let expected = r##"
    -
  • -

    foo

    -

    notcode

    -
  • -
  • -

    foo

    -
  • -
- -
code
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_275() { - let original = r##"- a - - b - - c - - d - - e - - f -- g -"##; - let expected = r##"
    -
  • a
  • -
  • b
  • -
  • c
  • -
  • d
  • -
  • e
  • -
  • f
  • -
  • g
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_276() { - let original = r##"1. a - - 2. b - - 3. c -"##; - let expected = r##"
    -
  1. -

    a

    -
  2. -
  3. -

    b

    -
  4. -
  5. -

    c

    -
  6. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_277() { - let original = r##"- a - - b - - c - - d - - e -"##; - let expected = r##"
    -
  • a
  • -
  • b
  • -
  • c
  • -
  • d -- e
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_278() { - let original = r##"1. a - - 2. b - - 3. c -"##; - let expected = r##"
    -
  1. -

    a

    -
  2. -
  3. -

    b

    -
  4. -
-
3. c
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_279() { - let original = r##"- a -- b - -- c -"##; - let expected = r##"
    -
  • -

    a

    -
  • -
  • -

    b

    -
  • -
  • -

    c

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_280() { - let original = r##"* a -* - -* c -"##; - let expected = r##"
    -
  • -

    a

    -
  • -
  • -
  • -

    c

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_281() { - let original = r##"- a -- b - - c -- d -"##; - let expected = r##"
    -
  • -

    a

    -
  • -
  • -

    b

    -

    c

    -
  • -
  • -

    d

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_282() { - let original = r##"- a -- b - - [ref]: /url -- d -"##; - let expected = r##"
    -
  • -

    a

    -
  • -
  • -

    b

    -
  • -
  • -

    d

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_283() { - let original = r##"- a -- ``` - b - - - ``` -- c -"##; - let expected = r##"
    -
  • a
  • -
  • -
    b
    -
    -
    -
    -
  • -
  • c
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_284() { - let original = r##"- a - - b - - c -- d -"##; - let expected = r##"
    -
  • a -
      -
    • -

      b

      -

      c

      -
    • -
    -
  • -
  • d
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_285() { - let original = r##"* a - > b - > -* c -"##; - let expected = r##"
    -
  • a -
    -

    b

    -
    -
  • -
  • c
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_286() { - let original = r##"- a - > b - ``` - c - ``` -- d -"##; - let expected = r##"
    -
  • a -
    -

    b

    -
    -
    c
    -
    -
  • -
  • d
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_287() { - let original = r##"- a -"##; - let expected = r##"
    -
  • a
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_288() { - let original = r##"- a - - b -"##; - let expected = r##"
    -
  • a -
      -
    • b
    • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_289() { - let original = r##"1. ``` - foo - ``` - - bar -"##; - let expected = r##"
    -
  1. -
    foo
    -
    -

    bar

    -
  2. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_290() { - let original = r##"* foo - * bar - - baz -"##; - let expected = r##"
    -
  • -

    foo

    -
      -
    • bar
    • -
    -

    baz

    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_291() { - let original = r##"- a - - b - - c - -- d - - e - - f -"##; - let expected = r##"
    -
  • -

    a

    -
      -
    • b
    • -
    • c
    • -
    -
  • -
  • -

    d

    -
      -
    • e
    • -
    • f
    • -
    -
  • -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_292() { - let original = r##"`hi`lo` -"##; - let expected = r##"

hilo`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_293() { - let original = r##"\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -"##; - let expected = r##"

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_294() { - let original = r##"\ \A\a\ \3\φ\« -"##; - let expected = r##"

\ \A\a\ \3\φ\«

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_295() { - let original = r##"\*not emphasized* -\
not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" -"##; - let expected = r##"

*not emphasized* -<br/> not a tag -[not a link](/foo) -`not code` -1. not a list -* not a list -# not a heading -[foo]: /url "not a reference"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_296() { - let original = r##"\\*emphasis* -"##; - let expected = r##"

\emphasis

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_297() { - let original = r##"foo\ -bar -"##; - let expected = r##"

foo
-bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_298() { - let original = r##"`` \[\` `` -"##; - let expected = r##"

\[\`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_299() { - let original = r##" \[\] -"##; - let expected = r##"
\[\]
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_300() { - let original = r##"~~~ -\[\] -~~~ -"##; - let expected = r##"
\[\]
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_301() { - let original = r##" -"##; - let expected = r##"

http://example.com?find=\*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_302() { - let original = r##" -"##; - let expected = r##" -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_303() { - let original = r##"[foo](/bar\* "ti\*tle") -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_304() { - let original = r##"[foo] - -[foo]: /bar\* "ti\*tle" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_305() { - let original = r##"``` foo\+bar -foo -``` -"##; - let expected = r##"
foo
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_306() { - let original = r##"  & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸ -"##; - let expected = r##"

& © Æ Ď -¾ ℋ ⅆ -∲ ≧̸

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_307() { - let original = r##"# Ӓ Ϡ � -"##; - let expected = r##"

# Ӓ Ϡ �

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_308() { - let original = r##"" ആ ಫ -"##; - let expected = r##"

" ആ ಫ

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_309() { - let original = r##"  &x; &#; &#x; -� -&#abcdef0; -&ThisIsNotDefined; &hi?; -"##; - let expected = r##"

&nbsp &x; &#; &#x; -&#987654321; -&#abcdef0; -&ThisIsNotDefined; &hi?;

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_310() { - let original = r##"© -"##; - let expected = r##"

&copy

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_311() { - let original = r##"&MadeUpEntity; -"##; - let expected = r##"

&MadeUpEntity;

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_312() { - let original = r##" -"##; - let expected = r##" -"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_313() { - let original = r##"[foo](/föö "föö") -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_314() { - let original = r##"[foo] - -[foo]: /föö "föö" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_315() { - let original = r##"``` föö -foo -``` -"##; - let expected = r##"
foo
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_316() { - let original = r##"`föö` -"##; - let expected = r##"

f&ouml;&ouml;

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_317() { - let original = r##" föfö -"##; - let expected = r##"
f&ouml;f&ouml;
-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_318() { - let original = r##"`foo` -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_319() { - let original = r##"`` foo ` bar `` -"##; - let expected = r##"

foo ` bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_320() { - let original = r##"` `` ` -"##; - let expected = r##"

``

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_321() { - let original = r##"` `` ` -"##; - let expected = r##"

``

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_322() { - let original = r##"` a` -"##; - let expected = r##"

a

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_323() { - let original = r##"` b ` -"##; - let expected = r##"

b

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_324() { - let original = r##"`` -foo -bar -baz -`` -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_325() { - let original = r##"`` -foo -`` -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_326() { - let original = r##"`foo bar -baz` -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_327() { - let original = r##"`foo\`bar` -"##; - let expected = r##"

foo\bar`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_328() { - let original = r##"``foo`bar`` -"##; - let expected = r##"

foo`bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_329() { - let original = r##"` foo `` bar ` -"##; - let expected = r##"

foo `` bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_330() { - let original = r##"*foo`*` -"##; - let expected = r##"

*foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_331() { - let original = r##"[not a `link](/foo`) -"##; - let expected = r##"

[not a link](/foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_332() { - let original = r##"`` -"##; - let expected = r##"

<a href="">`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_333() { - let original = r##"
` -"##; - let expected = r##"

`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_334() { - let original = r##"`` -"##; - let expected = r##"

<http://foo.bar.baz>`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_335() { - let original = r##"` -"##; - let expected = r##"

http://foo.bar.`baz`

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_336() { - let original = r##"```foo`` -"##; - let expected = r##"

```foo``

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_337() { - let original = r##"`foo -"##; - let expected = r##"

`foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_338() { - let original = r##"`foo``bar`` -"##; - let expected = r##"

`foobar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_339() { - let original = r##"*foo bar* -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_340() { - let original = r##"a * foo bar* -"##; - let expected = r##"

a * foo bar*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_341() { - let original = r##"a*"foo"* -"##; - let expected = r##"

a*"foo"*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_342() { - let original = r##"* a * -"##; - let expected = r##"

* a *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_343() { - let original = r##"foo*bar* -"##; - let expected = r##"

foobar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_344() { - let original = r##"5*6*78 -"##; - let expected = r##"

5678

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_345() { - let original = r##"_foo bar_ -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_346() { - let original = r##"_ foo bar_ -"##; - let expected = r##"

_ foo bar_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_347() { - let original = r##"a_"foo"_ -"##; - let expected = r##"

a_"foo"_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_348() { - let original = r##"foo_bar_ -"##; - let expected = r##"

foo_bar_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_349() { - let original = r##"5_6_78 -"##; - let expected = r##"

5_6_78

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_350() { - let original = r##"пристаням_стремятся_ -"##; - let expected = r##"

пристаням_стремятся_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_351() { - let original = r##"aa_"bb"_cc -"##; - let expected = r##"

aa_"bb"_cc

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_352() { - let original = r##"foo-_(bar)_ -"##; - let expected = r##"

foo-(bar)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_353() { - let original = r##"_foo* -"##; - let expected = r##"

_foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_354() { - let original = r##"*foo bar * -"##; - let expected = r##"

*foo bar *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_355() { - let original = r##"*foo bar -* -"##; - let expected = r##"

*foo bar -*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_356() { - let original = r##"*(*foo) -"##; - let expected = r##"

*(*foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_357() { - let original = r##"*(*foo*)* -"##; - let expected = r##"

(foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_358() { - let original = r##"*foo*bar -"##; - let expected = r##"

foobar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_359() { - let original = r##"_foo bar _ -"##; - let expected = r##"

_foo bar _

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_360() { - let original = r##"_(_foo) -"##; - let expected = r##"

_(_foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_361() { - let original = r##"_(_foo_)_ -"##; - let expected = r##"

(foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_362() { - let original = r##"_foo_bar -"##; - let expected = r##"

_foo_bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_363() { - let original = r##"_пристаням_стремятся -"##; - let expected = r##"

_пристаням_стремятся

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_364() { - let original = r##"_foo_bar_baz_ -"##; - let expected = r##"

foo_bar_baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_365() { - let original = r##"_(bar)_. -"##; - let expected = r##"

(bar).

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_366() { - let original = r##"**foo bar** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_367() { - let original = r##"** foo bar** -"##; - let expected = r##"

** foo bar**

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_368() { - let original = r##"a**"foo"** -"##; - let expected = r##"

a**"foo"**

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_369() { - let original = r##"foo**bar** -"##; - let expected = r##"

foobar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_370() { - let original = r##"__foo bar__ -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_371() { - let original = r##"__ foo bar__ -"##; - let expected = r##"

__ foo bar__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_372() { - let original = r##"__ -foo bar__ -"##; - let expected = r##"

__ -foo bar__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_373() { - let original = r##"a__"foo"__ -"##; - let expected = r##"

a__"foo"__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_374() { - let original = r##"foo__bar__ -"##; - let expected = r##"

foo__bar__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_375() { - let original = r##"5__6__78 -"##; - let expected = r##"

5__6__78

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_376() { - let original = r##"пристаням__стремятся__ -"##; - let expected = r##"

пристаням__стремятся__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_377() { - let original = r##"__foo, __bar__, baz__ -"##; - let expected = r##"

foo, bar, baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_378() { - let original = r##"foo-__(bar)__ -"##; - let expected = r##"

foo-(bar)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_379() { - let original = r##"**foo bar ** -"##; - let expected = r##"

**foo bar **

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_380() { - let original = r##"**(**foo) -"##; - let expected = r##"

**(**foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_381() { - let original = r##"*(**foo**)* -"##; - let expected = r##"

(foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_382() { - let original = r##"**Gomphocarpus (*Gomphocarpus physocarpus*, syn. -*Asclepias physocarpa*)** -"##; - let expected = r##"

Gomphocarpus (Gomphocarpus physocarpus, syn. -Asclepias physocarpa)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_383() { - let original = r##"**foo "*bar*" foo** -"##; - let expected = r##"

foo "bar" foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_384() { - let original = r##"**foo**bar -"##; - let expected = r##"

foobar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_385() { - let original = r##"__foo bar __ -"##; - let expected = r##"

__foo bar __

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_386() { - let original = r##"__(__foo) -"##; - let expected = r##"

__(__foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_387() { - let original = r##"_(__foo__)_ -"##; - let expected = r##"

(foo)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_388() { - let original = r##"__foo__bar -"##; - let expected = r##"

__foo__bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_389() { - let original = r##"__пристаням__стремятся -"##; - let expected = r##"

__пристаням__стремятся

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_390() { - let original = r##"__foo__bar__baz__ -"##; - let expected = r##"

foo__bar__baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_391() { - let original = r##"__(bar)__. -"##; - let expected = r##"

(bar).

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_392() { - let original = r##"*foo [bar](/url)* -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_393() { - let original = r##"*foo -bar* -"##; - let expected = r##"

foo -bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_394() { - let original = r##"_foo __bar__ baz_ -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_395() { - let original = r##"_foo _bar_ baz_ -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_396() { - let original = r##"__foo_ bar_ -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_397() { - let original = r##"*foo *bar** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_398() { - let original = r##"*foo **bar** baz* -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_399() { - let original = r##"*foo**bar**baz* -"##; - let expected = r##"

foobarbaz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_400() { - let original = r##"*foo**bar* -"##; - let expected = r##"

foo**bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_401() { - let original = r##"***foo** bar* -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_402() { - let original = r##"*foo **bar*** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_403() { - let original = r##"*foo**bar*** -"##; - let expected = r##"

foobar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_404() { - let original = r##"*foo **bar *baz* bim** bop* -"##; - let expected = r##"

foo bar baz bim bop

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_405() { - let original = r##"*foo [*bar*](/url)* -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_406() { - let original = r##"** is not an empty emphasis -"##; - let expected = r##"

** is not an empty emphasis

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_407() { - let original = r##"**** is not an empty strong emphasis -"##; - let expected = r##"

**** is not an empty strong emphasis

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_408() { - let original = r##"**foo [bar](/url)** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_409() { - let original = r##"**foo -bar** -"##; - let expected = r##"

foo -bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_410() { - let original = r##"__foo _bar_ baz__ -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_411() { - let original = r##"__foo __bar__ baz__ -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_412() { - let original = r##"____foo__ bar__ -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_413() { - let original = r##"**foo **bar**** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_414() { - let original = r##"**foo *bar* baz** -"##; - let expected = r##"

foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_415() { - let original = r##"**foo*bar*baz** -"##; - let expected = r##"

foobarbaz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_416() { - let original = r##"***foo* bar** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_417() { - let original = r##"**foo *bar*** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_418() { - let original = r##"**foo *bar **baz** -bim* bop** -"##; - let expected = r##"

foo bar baz -bim bop

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_419() { - let original = r##"**foo [*bar*](/url)** -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_420() { - let original = r##"__ is not an empty emphasis -"##; - let expected = r##"

__ is not an empty emphasis

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_421() { - let original = r##"____ is not an empty strong emphasis -"##; - let expected = r##"

____ is not an empty strong emphasis

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_422() { - let original = r##"foo *** -"##; - let expected = r##"

foo ***

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_423() { - let original = r##"foo *\** -"##; - let expected = r##"

foo *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_424() { - let original = r##"foo *_* -"##; - let expected = r##"

foo _

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_425() { - let original = r##"foo ***** -"##; - let expected = r##"

foo *****

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_426() { - let original = r##"foo **\*** -"##; - let expected = r##"

foo *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_427() { - let original = r##"foo **_** -"##; - let expected = r##"

foo _

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_428() { - let original = r##"**foo* -"##; - let expected = r##"

*foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_429() { - let original = r##"*foo** -"##; - let expected = r##"

foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_430() { - let original = r##"***foo** -"##; - let expected = r##"

*foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_431() { - let original = r##"****foo* -"##; - let expected = r##"

***foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_432() { - let original = r##"**foo*** -"##; - let expected = r##"

foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_433() { - let original = r##"*foo**** -"##; - let expected = r##"

foo***

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_434() { - let original = r##"foo ___ -"##; - let expected = r##"

foo ___

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_435() { - let original = r##"foo _\__ -"##; - let expected = r##"

foo _

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_436() { - let original = r##"foo _*_ -"##; - let expected = r##"

foo *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_437() { - let original = r##"foo _____ -"##; - let expected = r##"

foo _____

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_438() { - let original = r##"foo __\___ -"##; - let expected = r##"

foo _

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_439() { - let original = r##"foo __*__ -"##; - let expected = r##"

foo *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_440() { - let original = r##"__foo_ -"##; - let expected = r##"

_foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_441() { - let original = r##"_foo__ -"##; - let expected = r##"

foo_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_442() { - let original = r##"___foo__ -"##; - let expected = r##"

_foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_443() { - let original = r##"____foo_ -"##; - let expected = r##"

___foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_444() { - let original = r##"__foo___ -"##; - let expected = r##"

foo_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_445() { - let original = r##"_foo____ -"##; - let expected = r##"

foo___

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_446() { - let original = r##"**foo** -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_447() { - let original = r##"*_foo_* -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_448() { - let original = r##"__foo__ -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_449() { - let original = r##"_*foo*_ -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_450() { - let original = r##"****foo**** -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_451() { - let original = r##"____foo____ -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_452() { - let original = r##"******foo****** -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_453() { - let original = r##"***foo*** -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_454() { - let original = r##"_____foo_____ -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_455() { - let original = r##"*foo _bar* baz_ -"##; - let expected = r##"

foo _bar baz_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_456() { - let original = r##"*foo __bar *baz bim__ bam* -"##; - let expected = r##"

foo bar *baz bim bam

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_457() { - let original = r##"**foo **bar baz** -"##; - let expected = r##"

**foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_458() { - let original = r##"*foo *bar baz* -"##; - let expected = r##"

*foo bar baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_459() { - let original = r##"*[bar*](/url) -"##; - let expected = r##"

*bar*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_460() { - let original = r##"_foo [bar_](/url) -"##; - let expected = r##"

_foo bar_

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_461() { - let original = r##"* -"##; - let expected = r##"

*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_462() { - let original = r##"** -"##; - let expected = r##"

**

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_463() { - let original = r##"__ -"##; - let expected = r##"

__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_464() { - let original = r##"*a `*`* -"##; - let expected = r##"

a *

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_465() { - let original = r##"_a `_`_ -"##; - let expected = r##"

a _

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_466() { - let original = r##"**a -"##; - let expected = r##"

**ahttp://foo.bar/?q=**

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_467() { - let original = r##"__a -"##; - let expected = r##"

__ahttp://foo.bar/?q=__

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_468() { - let original = r##"[link](/uri "title") -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_469() { - let original = r##"[link](/uri) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_470() { - let original = r##"[link]() -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_471() { - let original = r##"[link](<>) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_472() { - let original = r##"[link](/my uri) -"##; - let expected = r##"

[link](/my uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_473() { - let original = r##"[link](
) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_474() { - let original = r##"[link](foo -bar) -"##; - let expected = r##"

[link](foo -bar)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_475() { - let original = r##"[link]() -"##; - let expected = r##"

[link]()

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_476() { - let original = r##"[link](\(foo\)) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_477() { - let original = r##"[link](foo(and(bar))) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_478() { - let original = r##"[link](foo\(and\(bar\)) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_479() { - let original = r##"[link]() -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_480() { - let original = r##"[link](foo\)\:) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_481() { - let original = r##"[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) -"##; - let expected = r##"

link

-

link

-

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_482() { - let original = r##"[link](foo\bar) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_483() { - let original = r##"[link](foo%20bä) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_484() { - let original = r##"[link]("title") -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_485() { - let original = r##"[link](/url "title") -[link](/url 'title') -[link](/url (title)) -"##; - let expected = r##"

link -link -link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_486() { - let original = r##"[link](/url "title \""") -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_487() { - let original = r##"[link](/url "title") -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_488() { - let original = r##"[link](/url "title "and" title") -"##; - let expected = r##"

[link](/url "title "and" title")

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_489() { - let original = r##"[link](/url 'title "and" title') -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_490() { - let original = r##"[link]( /uri - "title" ) -"##; - let expected = r##"

link

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_491() { - let original = r##"[link] (/uri) -"##; - let expected = r##"

[link] (/uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_492() { - let original = r##"[link [foo [bar]]](/uri) -"##; - let expected = r##"

link [foo [bar]]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_493() { - let original = r##"[link] bar](/uri) -"##; - let expected = r##"

[link] bar](/uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_494() { - let original = r##"[link [bar](/uri) -"##; - let expected = r##"

[link bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_495() { - let original = r##"[link \[bar](/uri) -"##; - let expected = r##"

link [bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_496() { - let original = r##"[link *foo **bar** `#`*](/uri) -"##; - let expected = r##"

link foo bar #

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_497() { - let original = r##"[![moon](moon.jpg)](/uri) -"##; - let expected = r##"

moon

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_498() { - let original = r##"[foo [bar](/uri)](/uri) -"##; - let expected = r##"

[foo bar](/uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_499() { - let original = r##"[foo *[bar [baz](/uri)](/uri)*](/uri) -"##; - let expected = r##"

[foo [bar baz](/uri)](/uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_500() { - let original = r##"![[[foo](uri1)](uri2)](uri3) -"##; - let expected = r##"

[foo](uri2)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_501() { - let original = r##"*[foo*](/uri) -"##; - let expected = r##"

*foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_502() { - let original = r##"[foo *bar](baz*) -"##; - let expected = r##"

foo *bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_503() { - let original = r##"*foo [bar* baz] -"##; - let expected = r##"

foo [bar baz]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_504() { - let original = r##"[foo -"##; - let expected = r##"

[foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_505() { - let original = r##"[foo`](/uri)` -"##; - let expected = r##"

[foo](/uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_506() { - let original = r##"[foo -"##; - let expected = r##"

[foohttp://example.com/?search=](uri)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_507() { - let original = r##"[foo][bar] - -[bar]: /url "title" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_508() { - let original = r##"[link [foo [bar]]][ref] - -[ref]: /uri -"##; - let expected = r##"

link [foo [bar]]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_509() { - let original = r##"[link \[bar][ref] - -[ref]: /uri -"##; - let expected = r##"

link [bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_510() { - let original = r##"[link *foo **bar** `#`*][ref] - -[ref]: /uri -"##; - let expected = r##"

link foo bar #

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_511() { - let original = r##"[![moon](moon.jpg)][ref] - -[ref]: /uri -"##; - let expected = r##"

moon

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_512() { - let original = r##"[foo [bar](/uri)][ref] - -[ref]: /uri -"##; - let expected = r##"

[foo bar]ref

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_513() { - let original = r##"[foo *bar [baz][ref]*][ref] - -[ref]: /uri -"##; - let expected = r##"

[foo bar baz]ref

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_514() { - let original = r##"*[foo*][ref] - -[ref]: /uri -"##; - let expected = r##"

*foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_515() { - let original = r##"[foo *bar][ref] - -[ref]: /uri -"##; - let expected = r##"

foo *bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_516() { - let original = r##"[foo - -[ref]: /uri -"##; - let expected = r##"

[foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_517() { - let original = r##"[foo`][ref]` - -[ref]: /uri -"##; - let expected = r##"

[foo][ref]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_518() { - let original = r##"[foo - -[ref]: /uri -"##; - let expected = r##"

[foohttp://example.com/?search=][ref]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_519() { - let original = r##"[foo][BaR] - -[bar]: /url "title" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_520() { - let original = r##"[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url -"##; - let expected = r##"

Толпой is a Russian word.

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_521() { - let original = r##"[Foo - bar]: /url - -[Baz][Foo bar] -"##; - let expected = r##"

Baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_522() { - let original = r##"[foo] [bar] - -[bar]: /url "title" -"##; - let expected = r##"

[foo] bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_523() { - let original = r##"[foo] -[bar] - -[bar]: /url "title" -"##; - let expected = r##"

[foo] -bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_524() { - let original = r##"[foo]: /url1 - -[foo]: /url2 - -[bar][foo] -"##; - let expected = r##"

bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_525() { - let original = r##"[bar][foo\!] - -[foo!]: /url -"##; - let expected = r##"

[bar][foo!]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_526() { - let original = r##"[foo][ref[] - -[ref[]: /uri -"##; - let expected = r##"

[foo][ref[]

-

[ref[]: /uri

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_527() { - let original = r##"[foo][ref[bar]] - -[ref[bar]]: /uri -"##; - let expected = r##"

[foo][ref[bar]]

-

[ref[bar]]: /uri

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_528() { - let original = r##"[[[foo]]] - -[[[foo]]]: /url -"##; - let expected = r##"

[[[foo]]]

-

[[[foo]]]: /url

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_529() { - let original = r##"[foo][ref\[] - -[ref\[]: /uri -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_530() { - let original = r##"[bar\\]: /uri - -[bar\\] -"##; - let expected = r##"

bar\

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_531() { - let original = r##"[] - -[]: /uri -"##; - let expected = r##"

[]

-

[]: /uri

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_532() { - let original = r##"[ - ] - -[ - ]: /uri -"##; - let expected = r##"

[ -]

-

[ -]: /uri

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_533() { - let original = r##"[foo][] - -[foo]: /url "title" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_534() { - let original = r##"[*foo* bar][] - -[*foo* bar]: /url "title" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_535() { - let original = r##"[Foo][] - -[foo]: /url "title" -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_536() { - let original = r##"[foo] -[] - -[foo]: /url "title" -"##; - let expected = r##"

foo -[]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_537() { - let original = r##"[foo] - -[foo]: /url "title" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_538() { - let original = r##"[*foo* bar] - -[*foo* bar]: /url "title" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_539() { - let original = r##"[[*foo* bar]] - -[*foo* bar]: /url "title" -"##; - let expected = r##"

[foo bar]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_540() { - let original = r##"[[bar [foo] - -[foo]: /url -"##; - let expected = r##"

[[bar foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_541() { - let original = r##"[Foo] - -[foo]: /url "title" -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_542() { - let original = r##"[foo] bar - -[foo]: /url -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_543() { - let original = r##"\[foo] - -[foo]: /url "title" -"##; - let expected = r##"

[foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_544() { - let original = r##"[foo*]: /url - -*[foo*] -"##; - let expected = r##"

*foo*

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_545() { - let original = r##"[foo][bar] - -[foo]: /url1 -[bar]: /url2 -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_546() { - let original = r##"[foo][] - -[foo]: /url1 -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_547() { - let original = r##"[foo]() - -[foo]: /url1 -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_548() { - let original = r##"[foo](not a link) - -[foo]: /url1 -"##; - let expected = r##"

foo(not a link)

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_549() { - let original = r##"[foo][bar][baz] - -[baz]: /url -"##; - let expected = r##"

[foo]bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_550() { - let original = r##"[foo][bar][baz] - -[baz]: /url1 -[bar]: /url2 -"##; - let expected = r##"

foobaz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_551() { - let original = r##"[foo][bar][baz] - -[baz]: /url1 -[foo]: /url2 -"##; - let expected = r##"

[foo]bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_552() { - let original = r##"![foo](/url "title") -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_553() { - let original = r##"![foo *bar*] - -[foo *bar*]: train.jpg "train & tracks" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_554() { - let original = r##"![foo ![bar](/url)](/url2) -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_555() { - let original = r##"![foo [bar](/url)](/url2) -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_556() { - let original = r##"![foo *bar*][] - -[foo *bar*]: train.jpg "train & tracks" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_557() { - let original = r##"![foo *bar*][foobar] - -[FOOBAR]: train.jpg "train & tracks" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_558() { - let original = r##"![foo](train.jpg) -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_559() { - let original = r##"My ![foo bar](/path/to/train.jpg "title" ) -"##; - let expected = r##"

My foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_560() { - let original = r##"![foo]() -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_561() { - let original = r##"![](/url) -"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_562() { - let original = r##"![foo][bar] - -[bar]: /url -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_563() { - let original = r##"![foo][bar] - -[BAR]: /url -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_564() { - let original = r##"![foo][] - -[foo]: /url "title" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_565() { - let original = r##"![*foo* bar][] - -[*foo* bar]: /url "title" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_566() { - let original = r##"![Foo][] - -[foo]: /url "title" -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_567() { - let original = r##"![foo] -[] - -[foo]: /url "title" -"##; - let expected = r##"

foo -[]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_568() { - let original = r##"![foo] - -[foo]: /url "title" -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_569() { - let original = r##"![*foo* bar] - -[*foo* bar]: /url "title" -"##; - let expected = r##"

foo bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_570() { - let original = r##"![[foo]] - -[[foo]]: /url "title" -"##; - let expected = r##"

![[foo]]

-

[[foo]]: /url "title"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_571() { - let original = r##"![Foo] - -[foo]: /url "title" -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_572() { - let original = r##"!\[foo] - -[foo]: /url "title" -"##; - let expected = r##"

![foo]

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_573() { - let original = r##"\![foo] - -[foo]: /url "title" -"##; - let expected = r##"

!foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_574() { - let original = r##" -"##; - let expected = r##"

http://foo.bar.baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_575() { - let original = r##" -"##; - let expected = r##"

http://foo.bar.baz/test?q=hello&id=22&boolean

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_576() { - let original = r##" -"##; - let expected = r##"

irc://foo.bar:2233/baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_577() { - let original = r##" -"##; - let expected = r##"

MAILTO:FOO@BAR.BAZ

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_578() { - let original = r##" -"##; - let expected = r##"

a+b+c:d

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_579() { - let original = r##" -"##; - let expected = r##"

made-up-scheme://foo,bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_580() { - let original = r##" -"##; - let expected = r##"

http://../

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_581() { - let original = r##" -"##; - let expected = r##"

localhost:5001/foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_582() { - let original = r##" -"##; - let expected = r##"

<http://foo.bar/baz bim>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_583() { - let original = r##" -"##; - let expected = r##"

http://example.com/\[\

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_584() { - let original = r##" -"##; - let expected = r##"

foo@bar.example.com

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_585() { - let original = r##" -"##; - let expected = r##"

foo+special@Bar.baz-bar0.com

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_586() { - let original = r##" -"##; - let expected = r##"

<foo+@bar.example.com>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_587() { - let original = r##"<> -"##; - let expected = r##"

<>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_588() { - let original = r##"< http://foo.bar > -"##; - let expected = r##"

< http://foo.bar >

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_589() { - let original = r##" -"##; - let expected = r##"

<m:abc>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_590() { - let original = r##" -"##; - let expected = r##"

<foo.bar.baz>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_591() { - let original = r##"http://example.com -"##; - let expected = r##"

http://example.com

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_592() { - let original = r##"foo@bar.example.com -"##; - let expected = r##"

foo@bar.example.com

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_593() { - let original = r##" -"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_594() { - let original = r##" -"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_595() { - let original = r##" -"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_596() { - let original = r##" -"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_597() { - let original = r##"Foo -"##; - let expected = r##"

Foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_598() { - let original = r##"<33> <__> -"##; - let expected = r##"

<33> <__>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_599() { - let original = r##"
-"##; - let expected = r##"

<a h*#ref="hi">

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_600() { - let original = r##"
<a href="hi'> <a href=hi'>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_601() { - let original = r##"< a>< -foo> - -"##; - let expected = r##"

< a>< -foo><bar/ > -<foo bar=baz -bim!bop />

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_602() { - let original = r##"
-"##; - let expected = r##"

<a href='bar'title=title>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_603() { - let original = r##"
-"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_604() { - let original = r##" -"##; - let expected = r##"

</a href="foo">

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_605() { - let original = r##"foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_606() { - let original = r##"foo -"##; - let expected = r##"

foo <!-- not a comment -- two hyphens -->

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_607() { - let original = r##"foo foo --> - -foo -"##; - let expected = r##"

foo <!--> foo -->

-

foo <!-- foo--->

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_608() { - let original = r##"foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_609() { - let original = r##"foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_610() { - let original = r##"foo &<]]> -"##; - let expected = r##"

foo &<]]>

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_611() { - let original = r##"foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_612() { - let original = r##"foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_613() { - let original = r##" -"##; - let expected = r##"

<a href=""">

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_614() { - let original = r##"foo -baz -"##; - let expected = r##"

foo
-baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_615() { - let original = r##"foo\ -baz -"##; - let expected = r##"

foo
-baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_616() { - let original = r##"foo -baz -"##; - let expected = r##"

foo
-baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_617() { - let original = r##"foo - bar -"##; - let expected = r##"

foo
-bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_618() { - let original = r##"foo\ - bar -"##; - let expected = r##"

foo
-bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_619() { - let original = r##"*foo -bar* -"##; - let expected = r##"

foo
-bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_620() { - let original = r##"*foo\ -bar* -"##; - let expected = r##"

foo
-bar

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_621() { - let original = r##"`code -span` -"##; - let expected = r##"

code span

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_622() { - let original = r##"`code\ -span` -"##; - let expected = r##"

code\ span

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_623() { - let original = r##"
-"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_624() { - let original = r##" -"##; - let expected = r##"

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_625() { - let original = r##"foo\ -"##; - let expected = r##"

foo\

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_626() { - let original = r##"foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_627() { - let original = r##"### foo\ -"##; - let expected = r##"

foo\

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_628() { - let original = r##"### foo -"##; - let expected = r##"

foo

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_629() { - let original = r##"foo -baz -"##; - let expected = r##"

foo -baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_630() { - let original = r##"foo - baz -"##; - let expected = r##"

foo -baz

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_631() { - let original = r##"hello $.;'there -"##; - let expected = r##"

hello $.;'there

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_632() { - let original = r##"Foo χρῆν -"##; - let expected = r##"

Foo χρῆν

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn spec_test_633() { - let original = r##"Multiple spaces -"##; - let expected = r##"

Multiple spaces

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } \ No newline at end of file diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/footnotes.rs rust-pulldown-cmark-0.8.0/tests/suite/footnotes.rs --- rust-pulldown-cmark-0.2.0/tests/suite/footnotes.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/footnotes.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,165 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn footnotes_test_1() { + let original = r##"Lorem ipsum.[^a] + +[^a]: Cool. +"##; + let expected = r##"

Lorem ipsum.1

+
1 +

Cool.

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_2() { + let original = r##"> This is the song that never ends.\ +> Yes it goes on and on my friends.[^lambchops] +> +> [^lambchops]: +"##; + let expected = r##"
+

This is the song that never ends.
+Yes it goes on and on my friends.1

+ +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_3() { + let original = r##"Songs that simply loop are a popular way to annoy people. [^examples] + +[^examples]: + * [The song that never ends](https://www.youtube.com/watch?v=0U2zJOryHKQ) + * [I know a song that gets on everybody's nerves](https://www.youtube.com/watch?v=TehWI09qxls) + * [Ninety-nine bottles of beer on the wall](https://www.youtube.com/watch?v=qVjCag8XoHQ) +"##; + let expected = r##"

Songs that simply loop are a popular way to annoy people. 1

+ +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_4() { + let original = r##"[^lorem]: If heaven ever wishes to grant me a boon, it will be a total effacing of the results of a mere chance which fixed my eye on a certain stray piece of shelf-paper. It was nothing on which I would naturally have stumbled in the course of my daily round, for it was an old number of an Australian journal, the Sydney Bulletin for April 18, 1925. It had escaped even the cutting bureau which had at the time of its issuance been avidly collecting material for my uncle's research. + +I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp. +"##; + let expected = r##"
1 +

If heaven ever wishes to grant me a boon, it will be a total effacing of the results of a mere chance which fixed my eye on a certain stray piece of shelf-paper. It was nothing on which I would naturally have stumbled in the course of my daily round, for it was an old number of an Australian journal, the Sydney Bulletin for April 18, 1925. It had escaped even the cutting bureau which had at the time of its issuance been avidly collecting material for my uncle's research.

+
+

I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp.

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_5() { + let original = r##"[^ipsum]: How much wood would a woodchuck chuck. + +If a woodchuck could chuck wood. + + +# Forms of entertainment that aren't childish +"##; + let expected = r##"
1 +

How much wood would a woodchuck chuck.

+
+

If a woodchuck could chuck wood.

+

Forms of entertainment that aren't childish

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_6() { + let original = r##"> He's also really stupid. [^why] +> +> [^why]: Because your mamma! + +As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet. +"##; + let expected = r##"
+

He's also really stupid. 1

+
1 +

Because your mamma!

+
+
+

As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_7() { + let original = r##"Nested footnotes are considered poor style. [^a] [^xkcd] + +[^a]: This does not mean that footnotes cannot reference each other. [^b] + +[^b]: This means that a footnote definition cannot be directly inside another footnote definition. +> This means that a footnote cannot be directly inside another footnote's body. [^e] +> +> [^e]: They can, however, be inside anything else. + +[^xkcd]: [The other kind of nested footnote is, however, considered poor style.](https://xkcd.com/1208/) +"##; + let expected = r##"

Nested footnotes are considered poor style. 1 2

+
1 +

This does not mean that footnotes cannot reference each other. 3

+
+
3 +

This means that a footnote definition cannot be directly inside another footnote definition.

+
+

This means that a footnote cannot be directly inside another footnote's body. 4

+
4 +

They can, however, be inside anything else.

+
+
+
+ +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn footnotes_test_8() { + let original = r##"[^Doh] Ray Me Fa So La Te Do! [^1] + +[^Doh]: I know. Wrong Doe. And it won't render right. +[^1]: Common for people practicing music. +"##; + let expected = r##"

1 Ray Me Fa So La Te Do! 2

+
1 +

I know. Wrong Doe. And it won't render right. +2: Common for people practicing music.

+
+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/gfm_strikethrough.rs rust-pulldown-cmark-0.8.0/tests/suite/gfm_strikethrough.rs --- rust-pulldown-cmark-0.2.0/tests/suite/gfm_strikethrough.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/gfm_strikethrough.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,27 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn gfm_strikethrough_test_1() { + let original = r##"~~Hi~~ Hello, world! +"##; + let expected = r##"

Hi Hello, world!

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_strikethrough_test_2() { + let original = r##"This ~~has a + +new paragraph~~. +"##; + let expected = r##"

This ~~has a

+

new paragraph~~.

+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/gfm_table.rs rust-pulldown-cmark-0.8.0/tests/suite/gfm_table.rs --- rust-pulldown-cmark-0.2.0/tests/suite/gfm_table.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/gfm_table.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,205 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn gfm_table_test_1() { + let original = r##"| foo | bar | +| --- | --- | +| baz | bim | +"##; + let expected = r##" + + + + + + + + + + + + +
foobar
bazbim
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_2() { + let original = r##"| abc | defghi | +:-: | -----------: +bar | baz +"##; + let expected = r##" + + + + + + + + + + + + +
abcdefghi
barbaz
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_3() { + let original = r##"| f\|oo | +| ------ | +| b `\|` az | +| b **\|** im | +"##; + let expected = r##" + + + + + + + + + + + + + +
f|oo
b \| az
b | im
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_4() { + let original = r##"| abc | def | +| --- | --- | +| bar | baz | +> bar +"##; + let expected = r##" + + + + + + + + + + + + +
abcdef
barbaz
+
+

bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_5() { + let original = r##"| abc | def | +| --- | --- | +| bar | baz | +bar + +bar +"##; + let expected = r##" + + + + + + + + + + + + + + + + +
abcdef
barbaz
bar
+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_6() { + let original = r##"| abc | def | +| --- | +| bar | +"##; + let expected = r##"

| abc | def | +| --- | +| bar |

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_7() { + let original = r##"| abc | def | +| --- | --- | +| bar | +| bar | baz | boo | +"##; + let expected = r##" + + + + + + + + + + + + + + + + +
abcdef
bar
barbaz
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_table_test_8() { + let original = r##"| abc | def | +| --- | --- | +"##; + let expected = r##" + + + + + + +
abcdef
+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/gfm_tasklist.rs rust-pulldown-cmark-0.8.0/tests/suite/gfm_tasklist.rs --- rust-pulldown-cmark-0.2.0/tests/suite/gfm_tasklist.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/gfm_tasklist.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,39 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn gfm_tasklist_test_1() { + let original = r##"- [ ] foo +- [x] bar +"##; + let expected = r##"
    +
  • foo
  • +
  • bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn gfm_tasklist_test_2() { + let original = r##"- [x] foo + - [ ] bar + - [x] baz +- [ ] bim +"##; + let expected = r##"
    +
  • foo +
      +
    • bar
    • +
    • baz
    • +
    +
  • +
  • bim
  • +
+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/mod.rs rust-pulldown-cmark-0.8.0/tests/suite/mod.rs --- rust-pulldown-cmark-0.2.0/tests/suite/mod.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/mod.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,13 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +pub use super::test_markdown_html; + +mod footnotes; +mod gfm_strikethrough; +mod gfm_table; +mod gfm_tasklist; +mod regression; +mod smart_punct; +mod spec; +mod table; diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/regression.rs rust-pulldown-cmark-0.8.0/tests/suite/regression.rs --- rust-pulldown-cmark-0.2.0/tests/suite/regression.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/regression.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,953 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn regression_test_1() { + let original = r##"
Testing 1..2..3.. + +This is a test of the details element. + +
+"##; + let expected = r##"
Testing 1..2..3.. +

This is a test of the details element.

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_2() { + let original = r##"see the [many] [articles] [on] [QuickCheck]. + +[many]: https://medium.com/@jlouis666/quickcheck-advice-c357efb4e7e6 +[articles]: http://www.quviq.com/products/erlang-quickcheck/ +[on]: https://wiki.haskell.org/Introduction_to_QuickCheck1 +[QuickCheck]: https://hackage.haskell.org/package/QuickCheck +"##; + let expected = r##"

see the + many + articles + on + QuickCheck. +

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_3() { + let original = r##"[![debug-stub-derive on crates.io][cratesio-image]][cratesio] +[![debug-stub-derive on docs.rs][docsrs-image]][docsrs] + +[cratesio-image]: https://img.shields.io/crates/v/debug_stub_derive.svg +[cratesio]: https://crates.io/crates/debug_stub_derive +[docsrs-image]: https://docs.rs/debug_stub_derive/badge.svg?version=0.3.0 +[docsrs]: https://docs.rs/debug_stub_derive/0.3.0/ +"##; + let expected = r##"

debug-stub-derive on crates.io +debug-stub-derive on docs.rs

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_4() { + let original = r##"| Title A | Title B | +| --------- | --------- | +| Content | Content | + +| Title A | Title B | Title C | Title D | +| --------- | --------- | --------- | ---------:| +| Content | Content | Conent | Content | +"##; + let expected = r##" + +
Title A Title B
Content Content
+ + +
Title A Title B Title C Title D
Content Content Conent Content
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_5() { + let original = r##"foo§__(bar)__ +"##; + let expected = r##"

foo§(bar)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_6() { + let original = r##" hello +"##; + let expected = r##"

https://example.com hello

+ +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_7() { + let original = r##"[foo][bar] + + +[bar]: a +"##; + let expected = r##"

foo

+ +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_8() { + let original = r##" +- **foo** (u8, u8) + + make something + +- **bar** (u16, u16) + + make something +"##; + let expected = r##" +
    +
  • +

    foo (u8, u8)

    +

    make something

    +
  • +
  • +

    bar (u16, u16)

    +

    make something

    +
  • +
+ +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_9() { + let original = r##"[` +i8 +`]( +../../../std/primitive.i8.html +) +"##; + let expected = r##"

i8

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_10() { + let original = r##"[a] + +[a]: /url (title\\*) +"##; + let expected = r##"

a

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_11() { + let original = r##"[a] + +[a]: /url (title\)) +"##; + let expected = r##"

a

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_12() { + let original = r##"[a] + +[a]: /url (title)) +"##; + let expected = r##"

[a]

+

[a]: /url (title))

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_13() { + let original = r##"a +"##; + let expected = r##"

a <?php this is not a valid processing tag

+

b

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_14() { + let original = r##"[a]: u\ +foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_15() { + let original = r##"\`foo` +"##; + let expected = r##"

`foo`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_16() { + let original = r##"foo\\ +bar +"##; + let expected = r##"

foo\ +bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_17() { + let original = r##"1\. foo + +1\) bar +"##; + let expected = r##"

1. foo

+

1) bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_18() { + let original = r##"1... + +1.2.3. + +1 2 3 . + +1.|2.-3. + +1)2)3) +"##; + let expected = r##"

1...

+

1.2.3.

+

1 2 3 .

+

1.|2.-3.

+

1)2)3)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_19() { + let original = r##"[](<<>) +"##; + let expected = r##"

[](<<>)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_20() { + let original = r##"\``foo``bar` +"##; + let expected = r##"

`foo``bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_21() { + let original = r##"\\`foo` +"##; + let expected = r##"

\foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_22() { + let original = r##"[\\]: x + +YOLO +"##; + let expected = r##"

YOLO

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_23() { + let original = r##"lorem ipsum +A | B +---|--- +foo | bar +"##; + let expected = r##"

lorem ipsum +A | B +---|--- +foo | bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_24() { + let original = r##"foo|bar +---|--- +foo|bar +"##; + let expected = r##" + +
foobar
foobar
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_25() { + let original = r##"foo|bar\\ +---|--- +foo|bar +"##; + let expected = r##" + +
foobar\
foobar
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_26() { + let original = r##"[](url) +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_27() { + let original = r##"[bar](url) +"##; + let expected = r##"

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_28() { + let original = r##"![](http://example.com/logo.png) +"##; + let expected = r##"

http://example.com

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_29() { + let original = r##"[ ](url) +"##; + let expected = r##"

http://one http://two

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_30() { + let original = r##"Markdown | Less | Pretty +--- | --- | --- + +some text +"##; + let expected = r##" +
Markdown Less Pretty
+

some text

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_31() { + let original = r##"1. > foo +2. > +"##; + let expected = r##"
    +
  1. +
    +

    foo

    +
    +
  2. +
  3. +
    +
    +
  4. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_32() { + let original = r##"[ +x + +]: f +"##; + let expected = r##"

[ +x

+

]: f

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_33() { + let original = r##"[foo]: +"##; + let expected = r##"

[foo]:

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_34() { + let original = r##"> [foo +> bar]: /url +> +> [foo bar] +"##; + let expected = r##"
+

foo bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_35() { + let original = r##"> foo | bar +> --- | --- +yolo | swag +"##; + let expected = r##"
+
foobar
+
+

yolo | swag

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_36() { + let original = r##" +"##; + let expected = r##" +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_37() { + let original = r##" +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_38() { + let original = r##"~~*_**__ + +__a__ +"##; + let expected = r##"

~~*_**__

+

a

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_39() { + let original = r##"> ` +> ` +"##; + let expected = r##"
+

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_40() { + let original = r##"`\|` +"##; + let expected = r##"

\|

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_41() { + let original = r##"Paragraph 1 + +Paragraph 2 +"##; + let expected = r##"

Paragraph 1

+

Paragraph 2

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_42() { + let original = r##"\[[link text](https://www.google.com/)\] +"##; + let expected = r##"

[link text]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_43() { + let original = r##"foo | bar +--- | --- +[a](< | url>) +"##; + let expected = r##"
foobar
[a](<url>)
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_44() { + let original = r##"[a](url " +- - - +") +"##; + let expected = r##"

[a](url "

+
+

")

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_45() { + let original = r##"[a](url + +) +"##; + let expected = r##"

[a](url

+

)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_46() { + let original = r##"[a](b " + +") +"##; + let expected = r##"

[a](b "

+

")

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_47() { + let original = r##" +"##; + let expected = r##"

<http:// >

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_48() { + let original = r##" +"##; + let expected = r##"

<http://>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_49() { + let original = r##"foo | bar +--- | --- + + +foobar + + +<http://baz + + +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_50() { + let original = r##"foo | bar +--- | --- + +"##; + let expected = r##" + + + + + + +
foobar
<http://>
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_51() { + let original = r##"\*hi\_ +"##; + let expected = r##"

*hi_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_52() { + let original = r##"email: \_ +"##; + let expected = r##"

email: john@example.com_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_53() { + let original = r##"> [link](/url 'foo +> bar') +"##; + let expected = r##"
+

link

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_54() { + let original = r##"> [foo +> bar]: /url +> +> [foo bar] +"##; + let expected = r##"
+

foo bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_55() { + let original = r##"> [foo bar]: /url +> +> [foo +> bar] +"##; + let expected = r##"
+

foo +bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_56() { + let original = r##"> - [a +> b c]: /foo + +[a b c] +"##; + let expected = r##"
+
    +
  • +
+
+

a b c

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_57() { + let original = r##"[a +> b]: /foo + +[a b] [a > b] +"##; + let expected = r##"

[a

+
+

b]: /foo

+
+

[a b] [a > b]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_58() { + let original = r##"[`cargo +package`] + +[`cargo package`]: https://example.com +"##; + let expected = r##"

cargo package

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_59() { + let original = r##"> [`cargo +> package`] + +[`cargo package`]: https://example.com +"##; + let expected = r##"
+

cargo package

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_60() { + let original = r##"> `cargo +> package` +"##; + let expected = r##"
+

cargo package

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_61() { + let original = r##"> Note: Though you should not rely on this, all pointers to title="Dynamically Sized Types">DSTs are currently twice the size of +> the size of `usize` and have the same alignment. +"##; + let expected = r##"
+

Note: Though you should not rely on this, all pointers to +DSTs are currently twice the size of +the size of usize and have the same alignment.

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_62() { + let original = r##"Lorem ipsum.[^a] + +An unordered list before the footnotes: +* Ipsum +* Lorem + +[^a]: Cool. +"##; + let expected = r##"

Lorem ipsum.1

+

An unordered list before the footnotes:

+
    +
  • Ipsum
  • +
  • Lorem
  • +
+
1 +

Cool.

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_63() { + let original = r##"[][a] + +[a]: b + +# assimp-rs [![][crates-badge]][crates] + +[crates]: https://crates.io/crates/assimp +[crates-badge]: http://meritbadge.herokuapp.com/assimp +"##; + let expected = r##"

+ +

assimp-rs

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_64() { + let original = r##"* A list. + + * A sublist. + + * Another sublist. + + +* A list. + + * A sublist. + + * Another sublist. + +"##; + let expected = r##"
    +
  • +

    A list.

    +
      +
    • +

      A sublist.

      +
    • +
    • +

      Another sublist.

      +
    • +
    +
  • +
  • +

    A list.

    +
      +
    • +

      A sublist.

      +
    • +
    • +

      Another sublist.

      +
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_65() { + let original = r##"<foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn regression_test_66() { + let original = r##"> > a > ="yo +> > lo"> +"##; + let expected = r##"
+
+

a

+
+
+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/smart_punct.rs rust-pulldown-cmark-0.8.0/tests/suite/smart_punct.rs --- rust-pulldown-cmark-0.2.0/tests/suite/smart_punct.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/smart_punct.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,201 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn smart_punct_test_1() { + let original = r##""Hello," said the spider. +"'Shelob' is my name." +"##; + let expected = r##"

“Hello,” said the spider. +“‘Shelob’ is my name.”

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_2() { + let original = r##"'A', 'B', and 'C' are letters. +"##; + let expected = r##"

‘A’, ‘B’, and ‘C’ are letters.

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_3() { + let original = r##"'Oak,' 'elm,' and 'beech' are names of trees. +So is 'pine.' +"##; + let expected = r##"

‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. +So is ‘pine.’

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_4() { + let original = r##"'He said, "I want to go."' +"##; + let expected = r##"

‘He said, “I want to go.”’

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_5() { + let original = r##"Were you alive in the 70's? +"##; + let expected = r##"

Were you alive in the 70’s?

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_6() { + let original = r##"Here is some quoted '`code`' and a "[quoted link](url)". +"##; + let expected = r##"

Here is some quoted ‘code’ and a “quoted link”.

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_7() { + let original = r##"'tis the season to be 'jolly' +"##; + let expected = r##"

’tis the season to be ‘jolly’

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_8() { + let original = r##"'We'll use Jane's boat and John's truck,' Jenna said. +"##; + let expected = r##"

‘We’ll use Jane’s boat and John’s truck,’ Jenna said.

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_9() { + let original = r##""A paragraph with no closing quote. + +"Second paragraph by same speaker, in fiction." +"##; + let expected = r##"

“A paragraph with no closing quote.

+

“Second paragraph by same speaker, in fiction.”

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_10() { + let original = r##"[a]'s b' +"##; + let expected = r##"

[a]’s b’

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_11() { + let original = r##"\"This is not smart.\" +This isn\'t either. +5\'8\" +"##; + let expected = r##"

"This is not smart." +This isn't either. +5'8"

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_12() { + let original = r##"Some dashes: em---em +en--en +em --- em +en -- en +2--3 +"##; + let expected = r##"

Some dashes: em—em +en–en +em — em +en – en +2–3

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_13() { + let original = r##"one- +two-- +three--- +four---- +five----- +six------ +seven------- +eight-------- +nine--------- +thirteen-------------. +"##; + let expected = r##"

one- +two– +three— +four–– +five—– +six—— +seven—–– +eight–––– +nine——— +thirteen———––.

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_14() { + let original = r##"Escaped hyphens: \-- \-\-\-. +"##; + let expected = r##"

Escaped hyphens: -- ---.

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_15() { + let original = r##"Ellipses...and...and.... +"##; + let expected = r##"

Ellipses…and…and….

+"##; + + test_markdown_html(original, expected, true); +} + +#[test] +fn smart_punct_test_16() { + let original = r##"No ellipses\.\.\. +"##; + let expected = r##"

No ellipses...

+"##; + + test_markdown_html(original, expected, true); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/spec.rs rust-pulldown-cmark-0.8.0/tests/suite/spec.rs --- rust-pulldown-cmark-0.2.0/tests/suite/spec.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/spec.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,8447 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn spec_test_1() { + let original = r##" foo baz bim +"##; + let expected = r##"
foo	baz		bim
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_2() { + let original = r##" foo baz bim +"##; + let expected = r##"
foo	baz		bim
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_3() { + let original = r##" a a + ὐ a +"##; + let expected = r##"
a	a
+ὐ	a
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_4() { + let original = r##" - foo + + bar +"##; + let expected = r##"
    +
  • +

    foo

    +

    bar

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_5() { + let original = r##"- foo + + bar +"##; + let expected = r##"
    +
  • +

    foo

    +
      bar
    +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_6() { + let original = r##"> foo +"##; + let expected = r##"
+
  foo
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_7() { + let original = r##"- foo +"##; + let expected = r##"
    +
  • +
      foo
    +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_8() { + let original = r##" foo + bar +"##; + let expected = r##"
foo
+bar
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_9() { + let original = r##" - foo + - bar + - baz +"##; + let expected = r##"
    +
  • foo +
      +
    • bar +
        +
      • baz
      • +
      +
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_10() { + let original = r##"# Foo +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_11() { + let original = r##"* * * +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_12() { + let original = r##"- `one +- two` +"##; + let expected = r##"
    +
  • `one
  • +
  • two`
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_13() { + let original = r##"*** +--- +___ +"##; + let expected = r##"
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_14() { + let original = r##"+++ +"##; + let expected = r##"

+++

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_15() { + let original = r##"=== +"##; + let expected = r##"

===

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_16() { + let original = r##"-- +** +__ +"##; + let expected = r##"

-- +** +__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_17() { + let original = r##" *** + *** + *** +"##; + let expected = r##"
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_18() { + let original = r##" *** +"##; + let expected = r##"
***
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_19() { + let original = r##"Foo + *** +"##; + let expected = r##"

Foo +***

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_20() { + let original = r##"_____________________________________ +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_21() { + let original = r##" - - - +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_22() { + let original = r##" ** * ** * ** * ** +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_23() { + let original = r##"- - - - +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_24() { + let original = r##"- - - - +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_25() { + let original = r##"_ _ _ _ a + +a------ + +---a--- +"##; + let expected = r##"

_ _ _ _ a

+

a------

+

---a---

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_26() { + let original = r##" *-* +"##; + let expected = r##"

-

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_27() { + let original = r##"- foo +*** +- bar +"##; + let expected = r##"
    +
  • foo
  • +
+
+
    +
  • bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_28() { + let original = r##"Foo +*** +bar +"##; + let expected = r##"

Foo

+
+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_29() { + let original = r##"Foo +--- +bar +"##; + let expected = r##"

Foo

+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_30() { + let original = r##"* Foo +* * * +* Bar +"##; + let expected = r##"
    +
  • Foo
  • +
+
+
    +
  • Bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_31() { + let original = r##"- Foo +- * * * +"##; + let expected = r##"
    +
  • Foo
  • +
  • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_32() { + let original = r##"# foo +## foo +### foo +#### foo +##### foo +###### foo +"##; + let expected = r##"

foo

+

foo

+

foo

+

foo

+
foo
+
foo
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_33() { + let original = r##"####### foo +"##; + let expected = r##"

####### foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_34() { + let original = r##"#5 bolt + +#hashtag +"##; + let expected = r##"

#5 bolt

+

#hashtag

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_35() { + let original = r##"\## foo +"##; + let expected = r##"

## foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_36() { + let original = r##"# foo *bar* \*baz\* +"##; + let expected = r##"

foo bar *baz*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_37() { + let original = r##"# foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_38() { + let original = r##" ### foo + ## foo + # foo +"##; + let expected = r##"

foo

+

foo

+

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_39() { + let original = r##" # foo +"##; + let expected = r##"
# foo
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_40() { + let original = r##"foo + # bar +"##; + let expected = r##"

foo +# bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_41() { + let original = r##"## foo ## + ### bar ### +"##; + let expected = r##"

foo

+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_42() { + let original = r##"# foo ################################## +##### foo ## +"##; + let expected = r##"

foo

+
foo
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_43() { + let original = r##"### foo ### +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_44() { + let original = r##"### foo ### b +"##; + let expected = r##"

foo ### b

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_45() { + let original = r##"# foo# +"##; + let expected = r##"

foo#

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_46() { + let original = r##"### foo \### +## foo #\## +# foo \# +"##; + let expected = r##"

foo ###

+

foo ###

+

foo #

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_47() { + let original = r##"**** +## foo +**** +"##; + let expected = r##"
+

foo

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_48() { + let original = r##"Foo bar +# baz +Bar foo +"##; + let expected = r##"

Foo bar

+

baz

+

Bar foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_49() { + let original = r##"## +# +### ### +"##; + let expected = r##"

+

+

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_50() { + let original = r##"Foo *bar* +========= + +Foo *bar* +--------- +"##; + let expected = r##"

Foo bar

+

Foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_51() { + let original = r##"Foo *bar +baz* +==== +"##; + let expected = r##"

Foo bar +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_52() { + let original = r##" Foo *bar +baz* +==== +"##; + let expected = r##"

Foo bar +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_53() { + let original = r##"Foo +------------------------- + +Foo += +"##; + let expected = r##"

Foo

+

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_54() { + let original = r##" Foo +--- + + Foo +----- + + Foo + === +"##; + let expected = r##"

Foo

+

Foo

+

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_55() { + let original = r##" Foo + --- + + Foo +--- +"##; + let expected = r##"
Foo
+---
+
+Foo
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_56() { + let original = r##"Foo + ---- +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_57() { + let original = r##"Foo + --- +"##; + let expected = r##"

Foo +---

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_58() { + let original = r##"Foo += = + +Foo +--- - +"##; + let expected = r##"

Foo += =

+

Foo

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_59() { + let original = r##"Foo +----- +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_60() { + let original = r##"Foo\ +---- +"##; + let expected = r##"

Foo\

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_61() { + let original = r##"`Foo +---- +` + + +"##; + let expected = r##"

`Foo

+

`

+

<a title="a lot

+

of dashes"/>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_62() { + let original = r##"> Foo +--- +"##; + let expected = r##"
+

Foo

+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_63() { + let original = r##"> foo +bar +=== +"##; + let expected = r##"
+

foo +bar +===

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_64() { + let original = r##"- Foo +--- +"##; + let expected = r##"
    +
  • Foo
  • +
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_65() { + let original = r##"Foo +Bar +--- +"##; + let expected = r##"

Foo +Bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_66() { + let original = r##"--- +Foo +--- +Bar +--- +Baz +"##; + let expected = r##"
+

Foo

+

Bar

+

Baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_67() { + let original = r##" +==== +"##; + let expected = r##"

====

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_68() { + let original = r##"--- +--- +"##; + let expected = r##"
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_69() { + let original = r##"- foo +----- +"##; + let expected = r##"
    +
  • foo
  • +
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_70() { + let original = r##" foo +--- +"##; + let expected = r##"
foo
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_71() { + let original = r##"> foo +----- +"##; + let expected = r##"
+

foo

+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_72() { + let original = r##"\> foo +------ +"##; + let expected = r##"

> foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_73() { + let original = r##"Foo + +bar +--- +baz +"##; + let expected = r##"

Foo

+

bar

+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_74() { + let original = r##"Foo +bar + +--- + +baz +"##; + let expected = r##"

Foo +bar

+
+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_75() { + let original = r##"Foo +bar +* * * +baz +"##; + let expected = r##"

Foo +bar

+
+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_76() { + let original = r##"Foo +bar +\--- +baz +"##; + let expected = r##"

Foo +bar +--- +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_77() { + let original = r##" a simple + indented code block +"##; + let expected = r##"
a simple
+  indented code block
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_78() { + let original = r##" - foo + + bar +"##; + let expected = r##"
    +
  • +

    foo

    +

    bar

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_79() { + let original = r##"1. foo + + - bar +"##; + let expected = r##"
    +
  1. +

    foo

    +
      +
    • bar
    • +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_80() { + let original = r##"
+ *hi* + + - one +"##; + let expected = r##"
<a/>
+*hi*
+
+- one
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_81() { + let original = r##" chunk1 + + chunk2 + + + + chunk3 +"##; + let expected = r##"
chunk1
+
+chunk2
+
+
+
+chunk3
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_82() { + let original = r##" chunk1 + + chunk2 +"##; + let expected = r##"
chunk1
+  
+  chunk2
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_83() { + let original = r##"Foo + bar + +"##; + let expected = r##"

Foo +bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_84() { + let original = r##" foo +bar +"##; + let expected = r##"
foo
+
+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_85() { + let original = r##"# Heading + foo +Heading +------ + foo +---- +"##; + let expected = r##"

Heading

+
foo
+
+

Heading

+
foo
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_86() { + let original = r##" foo + bar +"##; + let expected = r##"
    foo
+bar
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_87() { + let original = r##" + + foo + + +"##; + let expected = r##"
foo
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_88() { + let original = r##" foo +"##; + let expected = r##"
foo  
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_89() { + let original = r##"``` +< + > +``` +"##; + let expected = r##"
<
+ >
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_90() { + let original = r##"~~~ +< + > +~~~ +"##; + let expected = r##"
<
+ >
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_91() { + let original = r##"`` +foo +`` +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_92() { + let original = r##"``` +aaa +~~~ +``` +"##; + let expected = r##"
aaa
+~~~
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_93() { + let original = r##"~~~ +aaa +``` +~~~ +"##; + let expected = r##"
aaa
+```
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_94() { + let original = r##"```` +aaa +``` +`````` +"##; + let expected = r##"
aaa
+```
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_95() { + let original = r##"~~~~ +aaa +~~~ +~~~~ +"##; + let expected = r##"
aaa
+~~~
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_96() { + let original = r##"``` +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_97() { + let original = r##"````` + +``` +aaa +"##; + let expected = r##"

+```
+aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_98() { + let original = r##"> ``` +> aaa + +bbb +"##; + let expected = r##"
+
aaa
+
+
+

bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_99() { + let original = r##"``` + + +``` +"##; + let expected = r##"

+  
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_100() { + let original = r##"``` +``` +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_101() { + let original = r##" ``` + aaa +aaa +``` +"##; + let expected = r##"
aaa
+aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_102() { + let original = r##" ``` +aaa + aaa +aaa + ``` +"##; + let expected = r##"
aaa
+aaa
+aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_103() { + let original = r##" ``` + aaa + aaa + aaa + ``` +"##; + let expected = r##"
aaa
+ aaa
+aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_104() { + let original = r##" ``` + aaa + ``` +"##; + let expected = r##"
```
+aaa
+```
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_105() { + let original = r##"``` +aaa + ``` +"##; + let expected = r##"
aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_106() { + let original = r##" ``` +aaa + ``` +"##; + let expected = r##"
aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_107() { + let original = r##"``` +aaa + ``` +"##; + let expected = r##"
aaa
+    ```
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_108() { + let original = r##"``` ``` +aaa +"##; + let expected = r##"

+aaa

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_109() { + let original = r##"~~~~~~ +aaa +~~~ ~~ +"##; + let expected = r##"
aaa
+~~~ ~~
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_110() { + let original = r##"foo +``` +bar +``` +baz +"##; + let expected = r##"

foo

+
bar
+
+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_111() { + let original = r##"foo +--- +~~~ +bar +~~~ +# baz +"##; + let expected = r##"

foo

+
bar
+
+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_112() { + let original = r##"```ruby +def foo(x) + return 3 +end +``` +"##; + let expected = r##"
def foo(x)
+  return 3
+end
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_113() { + let original = r##"~~~~ ruby startline=3 $%@#$ +def foo(x) + return 3 +end +~~~~~~~ +"##; + let expected = r##"
def foo(x)
+  return 3
+end
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_114() { + let original = r##"````; +```` +"##; + let expected = r##"
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_115() { + let original = r##"``` aa ``` +foo +"##; + let expected = r##"

aa +foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_116() { + let original = r##"~~~ aa ``` ~~~ +foo +~~~ +"##; + let expected = r##"
foo
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_117() { + let original = r##"``` +``` aaa +``` +"##; + let expected = r##"
``` aaa
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_118() { + let original = r##"
+
+**Hello**,
+
+_world_.
+
+
+"##; + let expected = r##"
+
+**Hello**,
+

world. +

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_119() { + let original = r##" + + + +
+ hi +
+ +okay. +"##; + let expected = r##" + + + +
+ hi +
+

okay.

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_120() { + let original = r##"
+*foo* +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_122() { + let original = r##"
+ +*Markdown* + +
+"##; + let expected = r##"
+

Markdown

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_123() { + let original = r##"
+
+"##; + let expected = r##"
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_124() { + let original = r##"
+
+"##; + let expected = r##"
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_125() { + let original = r##"
+*foo* + +*bar* +"##; + let expected = r##"
+*foo* +

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_126() { + let original = r##"
+"##; + let expected = r##" +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_130() { + let original = r##"
+foo +
+"##; + let expected = r##"
+foo +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_131() { + let original = r##"
+``` c +int x = 33; +``` +"##; + let expected = r##"
+``` c +int x = 33; +``` +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_132() { + let original = r##" +*bar* + +"##; + let expected = r##" +*bar* + +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_133() { + let original = r##" +*bar* + +"##; + let expected = r##" +*bar* + +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_134() { + let original = r##" +*bar* + +"##; + let expected = r##" +*bar* + +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_135() { + let original = r##" +*bar* +"##; + let expected = r##" +*bar* +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_136() { + let original = r##" +*foo* + +"##; + let expected = r##" +*foo* + +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_137() { + let original = r##" + +*foo* + + +"##; + let expected = r##" +

foo

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_138() { + let original = r##"*foo* +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_139() { + let original = r##"

+import Text.HTML.TagSoup
+
+main :: IO ()
+main = print $ parseTags tags
+
+okay +"##; + let expected = r##"

+import Text.HTML.TagSoup
+
+main :: IO ()
+main = print $ parseTags tags
+
+

okay

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_140() { + let original = r##" +okay +"##; + let expected = r##" +

okay

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_141() { + let original = r##" +okay +"##; + let expected = r##" +

okay

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_142() { + let original = r##" +*foo* +"##; + let expected = r##" +

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_146() { + let original = r##"*bar* +*baz* +"##; + let expected = r##"*bar* +

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_147() { + let original = r##"1. *bar* +"##; + let expected = r##"1. *bar* +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_148() { + let original = r##" +okay +"##; + let expected = r##" +

okay

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_149() { + let original = r##"'; + +?> +okay +"##; + let expected = r##"'; + +?> +

okay

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_150() { + let original = r##" +"##; + let expected = r##" +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_151() { + let original = r##" +okay +"##; + let expected = r##" +

okay

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_152() { + let original = r##" + + +"##; + let expected = r##" +
<!-- foo -->
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_153() { + let original = r##"
+ +
+"##; + let expected = r##"
+
<div>
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_154() { + let original = r##"Foo +
+bar +
+"##; + let expected = r##"

Foo

+
+bar +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_155() { + let original = r##"
+bar +
+*foo* +"##; + let expected = r##"
+bar +
+*foo* +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_156() { + let original = r##"Foo + +baz +"##; + let expected = r##"

Foo + +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_157() { + let original = r##"
+ +*Emphasized* text. + +
+"##; + let expected = r##"
+

Emphasized text.

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_158() { + let original = r##"
+*Emphasized* text. +
+"##; + let expected = r##"
+*Emphasized* text. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_159() { + let original = r##" + + + + + + + +
+Hi +
+"##; + let expected = r##" + + + +
+Hi +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_160() { + let original = r##" + + + + + + + +
+ Hi +
+"##; + let expected = r##" + +
<td>
+  Hi
+</td>
+
+ +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_161() { + let original = r##"[foo]: /url "title" + +[foo] +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_162() { + let original = r##" [foo]: + /url + 'the title' + +[foo] +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_163() { + let original = r##"[Foo*bar\]]:my_(url) 'title (with parens)' + +[Foo*bar\]] +"##; + let expected = r##"

Foo*bar]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_164() { + let original = r##"[Foo bar]: + +'title' + +[Foo bar] +"##; + let expected = r##"

Foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_165() { + let original = r##"[foo]: /url ' +title +line1 +line2 +' + +[foo] +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_166() { + let original = r##"[foo]: /url 'title + +with blank line' + +[foo] +"##; + let expected = r##"

[foo]: /url 'title

+

with blank line'

+

[foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_167() { + let original = r##"[foo]: +/url + +[foo] +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_168() { + let original = r##"[foo]: + +[foo] +"##; + let expected = r##"

[foo]:

+

[foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_169() { + let original = r##"[foo]: <> + +[foo] +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_170() { + let original = r##"[foo]: (baz) + +[foo] +"##; + let expected = r##"

[foo]: (baz)

+

[foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_171() { + let original = r##"[foo]: /url\bar\*baz "foo\"bar\baz" + +[foo] +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_172() { + let original = r##"[foo] + +[foo]: url +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_173() { + let original = r##"[foo] + +[foo]: first +[foo]: second +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_174() { + let original = r##"[FOO]: /url + +[Foo] +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_175() { + let original = r##"[ΑΓΩ]: /φου + +[αγω] +"##; + let expected = r##"

αγω

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_176() { + let original = r##"[foo]: /url +"##; + let expected = r##""##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_177() { + let original = r##"[ +foo +]: /url +bar +"##; + let expected = r##"

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_178() { + let original = r##"[foo]: /url "title" ok +"##; + let expected = r##"

[foo]: /url "title" ok

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_179() { + let original = r##"[foo]: /url +"title" ok +"##; + let expected = r##"

"title" ok

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_180() { + let original = r##" [foo]: /url "title" + +[foo] +"##; + let expected = r##"
[foo]: /url "title"
+
+

[foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_181() { + let original = r##"``` +[foo]: /url +``` + +[foo] +"##; + let expected = r##"
[foo]: /url
+
+

[foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_182() { + let original = r##"Foo +[bar]: /baz + +[bar] +"##; + let expected = r##"

Foo +[bar]: /baz

+

[bar]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_183() { + let original = r##"# [Foo] +[foo]: /url +> bar +"##; + let expected = r##"

Foo

+
+

bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_184() { + let original = r##"[foo]: /url +bar +=== +[foo] +"##; + let expected = r##"

bar

+

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_185() { + let original = r##"[foo]: /url +=== +[foo] +"##; + let expected = r##"

=== +foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_186() { + let original = r##"[foo]: /foo-url "foo" +[bar]: /bar-url + "bar" +[baz]: /baz-url + +[foo], +[bar], +[baz] +"##; + let expected = r##"

foo, +bar, +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_187() { + let original = r##"[foo] + +> [foo]: /url +"##; + let expected = r##"

foo

+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_188() { + let original = r##"[foo]: /url +"##; + let expected = r##""##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_189() { + let original = r##"aaa + +bbb +"##; + let expected = r##"

aaa

+

bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_190() { + let original = r##"aaa +bbb + +ccc +ddd +"##; + let expected = r##"

aaa +bbb

+

ccc +ddd

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_191() { + let original = r##"aaa + + +bbb +"##; + let expected = r##"

aaa

+

bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_192() { + let original = r##" aaa + bbb +"##; + let expected = r##"

aaa +bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_193() { + let original = r##"aaa + bbb + ccc +"##; + let expected = r##"

aaa +bbb +ccc

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_194() { + let original = r##" aaa +bbb +"##; + let expected = r##"

aaa +bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_195() { + let original = r##" aaa +bbb +"##; + let expected = r##"
aaa
+
+

bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_196() { + let original = r##"aaa +bbb +"##; + let expected = r##"

aaa
+bbb

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_197() { + let original = r##" + +aaa + + +# aaa + + +"##; + let expected = r##"

aaa

+

aaa

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_198() { + let original = r##"> # Foo +> bar +> baz +"##; + let expected = r##"
+

Foo

+

bar +baz

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_199() { + let original = r##"># Foo +>bar +> baz +"##; + let expected = r##"
+

Foo

+

bar +baz

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_200() { + let original = r##" > # Foo + > bar + > baz +"##; + let expected = r##"
+

Foo

+

bar +baz

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_201() { + let original = r##" > # Foo + > bar + > baz +"##; + let expected = r##"
> # Foo
+> bar
+> baz
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_202() { + let original = r##"> # Foo +> bar +baz +"##; + let expected = r##"
+

Foo

+

bar +baz

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_203() { + let original = r##"> bar +baz +> foo +"##; + let expected = r##"
+

bar +baz +foo

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_204() { + let original = r##"> foo +--- +"##; + let expected = r##"
+

foo

+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_205() { + let original = r##"> - foo +- bar +"##; + let expected = r##"
+
    +
  • foo
  • +
+
+
    +
  • bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_206() { + let original = r##"> foo + bar +"##; + let expected = r##"
+
foo
+
+
+
bar
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_207() { + let original = r##"> ``` +foo +``` +"##; + let expected = r##"
+
+
+

foo

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_208() { + let original = r##"> foo + - bar +"##; + let expected = r##"
+

foo +- bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_209() { + let original = r##"> +"##; + let expected = r##"
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_210() { + let original = r##"> +> +> +"##; + let expected = r##"
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_211() { + let original = r##"> +> foo +> +"##; + let expected = r##"
+

foo

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_212() { + let original = r##"> foo + +> bar +"##; + let expected = r##"
+

foo

+
+
+

bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_213() { + let original = r##"> foo +> bar +"##; + let expected = r##"
+

foo +bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_214() { + let original = r##"> foo +> +> bar +"##; + let expected = r##"
+

foo

+

bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_215() { + let original = r##"foo +> bar +"##; + let expected = r##"

foo

+
+

bar

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_216() { + let original = r##"> aaa +*** +> bbb +"##; + let expected = r##"
+

aaa

+
+
+
+

bbb

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_217() { + let original = r##"> bar +baz +"##; + let expected = r##"
+

bar +baz

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_218() { + let original = r##"> bar + +baz +"##; + let expected = r##"
+

bar

+
+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_219() { + let original = r##"> bar +> +baz +"##; + let expected = r##"
+

bar

+
+

baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_220() { + let original = r##"> > > foo +bar +"##; + let expected = r##"
+
+
+

foo +bar

+
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_221() { + let original = r##">>> foo +> bar +>>baz +"##; + let expected = r##"
+
+
+

foo +bar +baz

+
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_222() { + let original = r##"> code + +> not code +"##; + let expected = r##"
+
code
+
+
+
+

not code

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_223() { + let original = r##"A paragraph +with two lines. + + indented code + +> A block quote. +"##; + let expected = r##"

A paragraph +with two lines.

+
indented code
+
+
+

A block quote.

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_224() { + let original = r##"1. A paragraph + with two lines. + + indented code + + > A block quote. +"##; + let expected = r##"
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_225() { + let original = r##"- one + + two +"##; + let expected = r##"
    +
  • one
  • +
+

two

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_226() { + let original = r##"- one + + two +"##; + let expected = r##"
    +
  • +

    one

    +

    two

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_227() { + let original = r##" - one + + two +"##; + let expected = r##"
    +
  • one
  • +
+
 two
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_228() { + let original = r##" - one + + two +"##; + let expected = r##"
    +
  • +

    one

    +

    two

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_229() { + let original = r##" > > 1. one +>> +>> two +"##; + let expected = r##"
+
+
    +
  1. +

    one

    +

    two

    +
  2. +
+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_230() { + let original = r##">>- one +>> + > > two +"##; + let expected = r##"
+
+
    +
  • one
  • +
+

two

+
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_231() { + let original = r##"-one + +2.two +"##; + let expected = r##"

-one

+

2.two

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_232() { + let original = r##"- foo + + + bar +"##; + let expected = r##"
    +
  • +

    foo

    +

    bar

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_233() { + let original = r##"1. foo + + ``` + bar + ``` + + baz + + > bam +"##; + let expected = r##"
    +
  1. +

    foo

    +
    bar
    +
    +

    baz

    +
    +

    bam

    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_234() { + let original = r##"- Foo + + bar + + + baz +"##; + let expected = r##"
    +
  • +

    Foo

    +
    bar
    +
    +
    +baz
    +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_235() { + let original = r##"123456789. ok +"##; + let expected = r##"
    +
  1. ok
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_236() { + let original = r##"1234567890. not ok +"##; + let expected = r##"

1234567890. not ok

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_237() { + let original = r##"0. ok +"##; + let expected = r##"
    +
  1. ok
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_238() { + let original = r##"003. ok +"##; + let expected = r##"
    +
  1. ok
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_239() { + let original = r##"-1. not ok +"##; + let expected = r##"

-1. not ok

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_240() { + let original = r##"- foo + + bar +"##; + let expected = r##"
    +
  • +

    foo

    +
    bar
    +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_241() { + let original = r##" 10. foo + + bar +"##; + let expected = r##"
    +
  1. +

    foo

    +
    bar
    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_242() { + let original = r##" indented code + +paragraph + + more code +"##; + let expected = r##"
indented code
+
+

paragraph

+
more code
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_243() { + let original = r##"1. indented code + + paragraph + + more code +"##; + let expected = r##"
    +
  1. +
    indented code
    +
    +

    paragraph

    +
    more code
    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_244() { + let original = r##"1. indented code + + paragraph + + more code +"##; + let expected = r##"
    +
  1. +
     indented code
    +
    +

    paragraph

    +
    more code
    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_245() { + let original = r##" foo + +bar +"##; + let expected = r##"

foo

+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_246() { + let original = r##"- foo + + bar +"##; + let expected = r##"
    +
  • foo
  • +
+

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_247() { + let original = r##"- foo + + bar +"##; + let expected = r##"
    +
  • +

    foo

    +

    bar

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_248() { + let original = r##"- + foo +- + ``` + bar + ``` +- + baz +"##; + let expected = r##"
    +
  • foo
  • +
  • +
    bar
    +
    +
  • +
  • +
    baz
    +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_249() { + let original = r##"- + foo +"##; + let expected = r##"
    +
  • foo
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_250() { + let original = r##"- + + foo +"##; + let expected = r##"
    +
  • +
+

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_251() { + let original = r##"- foo +- +- bar +"##; + let expected = r##"
    +
  • foo
  • +
  • +
  • bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_252() { + let original = r##"- foo +- +- bar +"##; + let expected = r##"
    +
  • foo
  • +
  • +
  • bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_253() { + let original = r##"1. foo +2. +3. bar +"##; + let expected = r##"
    +
  1. foo
  2. +
  3. +
  4. bar
  5. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_254() { + let original = r##"* +"##; + let expected = r##"
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_255() { + let original = r##"foo +* + +foo +1. +"##; + let expected = r##"

foo +*

+

foo +1.

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_256() { + let original = r##" 1. A paragraph + with two lines. + + indented code + + > A block quote. +"##; + let expected = r##"
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_257() { + let original = r##" 1. A paragraph + with two lines. + + indented code + + > A block quote. +"##; + let expected = r##"
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_258() { + let original = r##" 1. A paragraph + with two lines. + + indented code + + > A block quote. +"##; + let expected = r##"
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_259() { + let original = r##" 1. A paragraph + with two lines. + + indented code + + > A block quote. +"##; + let expected = r##"
1.  A paragraph
+    with two lines.
+
+        indented code
+
+    > A block quote.
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_260() { + let original = r##" 1. A paragraph +with two lines. + + indented code + + > A block quote. +"##; + let expected = r##"
    +
  1. +

    A paragraph +with two lines.

    +
    indented code
    +
    +
    +

    A block quote.

    +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_261() { + let original = r##" 1. A paragraph + with two lines. +"##; + let expected = r##"
    +
  1. A paragraph +with two lines.
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_262() { + let original = r##"> 1. > Blockquote +continued here. +"##; + let expected = r##"
+
    +
  1. +
    +

    Blockquote +continued here.

    +
    +
  2. +
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_263() { + let original = r##"> 1. > Blockquote +> continued here. +"##; + let expected = r##"
+
    +
  1. +
    +

    Blockquote +continued here.

    +
    +
  2. +
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_264() { + let original = r##"- foo + - bar + - baz + - boo +"##; + let expected = r##"
    +
  • foo +
      +
    • bar +
        +
      • baz +
          +
        • boo
        • +
        +
      • +
      +
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_265() { + let original = r##"- foo + - bar + - baz + - boo +"##; + let expected = r##"
    +
  • foo
  • +
  • bar
  • +
  • baz
  • +
  • boo
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_266() { + let original = r##"10) foo + - bar +"##; + let expected = r##"
    +
  1. foo +
      +
    • bar
    • +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_267() { + let original = r##"10) foo + - bar +"##; + let expected = r##"
    +
  1. foo
  2. +
+
    +
  • bar
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_268() { + let original = r##"- - foo +"##; + let expected = r##"
    +
  • +
      +
    • foo
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_269() { + let original = r##"1. - 2. foo +"##; + let expected = r##"
    +
  1. +
      +
    • +
        +
      1. foo
      2. +
      +
    • +
    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_270() { + let original = r##"- # Foo +- Bar + --- + baz +"##; + let expected = r##"
    +
  • +

    Foo

    +
  • +
  • +

    Bar

    +baz
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_271() { + let original = r##"- foo +- bar ++ baz +"##; + let expected = r##"
    +
  • foo
  • +
  • bar
  • +
+
    +
  • baz
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_272() { + let original = r##"1. foo +2. bar +3) baz +"##; + let expected = r##"
    +
  1. foo
  2. +
  3. bar
  4. +
+
    +
  1. baz
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_273() { + let original = r##"Foo +- bar +- baz +"##; + let expected = r##"

Foo

+
    +
  • bar
  • +
  • baz
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_274() { + let original = r##"The number of windows in my house is +14. The number of doors is 6. +"##; + let expected = r##"

The number of windows in my house is +14. The number of doors is 6.

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_275() { + let original = r##"The number of windows in my house is +1. The number of doors is 6. +"##; + let expected = r##"

The number of windows in my house is

+
    +
  1. The number of doors is 6.
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_276() { + let original = r##"- foo + +- bar + + +- baz +"##; + let expected = r##"
    +
  • +

    foo

    +
  • +
  • +

    bar

    +
  • +
  • +

    baz

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_277() { + let original = r##"- foo + - bar + - baz + + + bim +"##; + let expected = r##"
    +
  • foo +
      +
    • bar +
        +
      • +

        baz

        +

        bim

        +
      • +
      +
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_278() { + let original = r##"- foo +- bar + + + +- baz +- bim +"##; + let expected = r##"
    +
  • foo
  • +
  • bar
  • +
+ +
    +
  • baz
  • +
  • bim
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_279() { + let original = r##"- foo + + notcode + +- foo + + + + code +"##; + let expected = r##"
    +
  • +

    foo

    +

    notcode

    +
  • +
  • +

    foo

    +
  • +
+ +
code
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_280() { + let original = r##"- a + - b + - c + - d + - e + - f +- g +"##; + let expected = r##"
    +
  • a
  • +
  • b
  • +
  • c
  • +
  • d
  • +
  • e
  • +
  • f
  • +
  • g
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_281() { + let original = r##"1. a + + 2. b + + 3. c +"##; + let expected = r##"
    +
  1. +

    a

    +
  2. +
  3. +

    b

    +
  4. +
  5. +

    c

    +
  6. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_282() { + let original = r##"- a + - b + - c + - d + - e +"##; + let expected = r##"
    +
  • a
  • +
  • b
  • +
  • c
  • +
  • d +- e
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_283() { + let original = r##"1. a + + 2. b + + 3. c +"##; + let expected = r##"
    +
  1. +

    a

    +
  2. +
  3. +

    b

    +
  4. +
+
3. c
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_284() { + let original = r##"- a +- b + +- c +"##; + let expected = r##"
    +
  • +

    a

    +
  • +
  • +

    b

    +
  • +
  • +

    c

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_285() { + let original = r##"* a +* + +* c +"##; + let expected = r##"
    +
  • +

    a

    +
  • +
  • +
  • +

    c

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_286() { + let original = r##"- a +- b + + c +- d +"##; + let expected = r##"
    +
  • +

    a

    +
  • +
  • +

    b

    +

    c

    +
  • +
  • +

    d

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_287() { + let original = r##"- a +- b + + [ref]: /url +- d +"##; + let expected = r##"
    +
  • +

    a

    +
  • +
  • +

    b

    +
  • +
  • +

    d

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_288() { + let original = r##"- a +- ``` + b + + + ``` +- c +"##; + let expected = r##"
    +
  • a
  • +
  • +
    b
    +
    +
    +
    +
  • +
  • c
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_289() { + let original = r##"- a + - b + + c +- d +"##; + let expected = r##"
    +
  • a +
      +
    • +

      b

      +

      c

      +
    • +
    +
  • +
  • d
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_290() { + let original = r##"* a + > b + > +* c +"##; + let expected = r##"
    +
  • a +
    +

    b

    +
    +
  • +
  • c
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_291() { + let original = r##"- a + > b + ``` + c + ``` +- d +"##; + let expected = r##"
    +
  • a +
    +

    b

    +
    +
    c
    +
    +
  • +
  • d
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_292() { + let original = r##"- a +"##; + let expected = r##"
    +
  • a
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_293() { + let original = r##"- a + - b +"##; + let expected = r##"
    +
  • a +
      +
    • b
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_294() { + let original = r##"1. ``` + foo + ``` + + bar +"##; + let expected = r##"
    +
  1. +
    foo
    +
    +

    bar

    +
  2. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_295() { + let original = r##"* foo + * bar + + baz +"##; + let expected = r##"
    +
  • +

    foo

    +
      +
    • bar
    • +
    +

    baz

    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_296() { + let original = r##"- a + - b + - c + +- d + - e + - f +"##; + let expected = r##"
    +
  • +

    a

    +
      +
    • b
    • +
    • c
    • +
    +
  • +
  • +

    d

    +
      +
    • e
    • +
    • f
    • +
    +
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_297() { + let original = r##"`hi`lo` +"##; + let expected = r##"

hilo`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_298() { + let original = r##"\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ +"##; + let expected = r##"

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_299() { + let original = r##"\ \A\a\ \3\φ\« +"##; + let expected = r##"

\ \A\a\ \3\φ\«

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_300() { + let original = r##"\*not emphasized* +\
not a tag +\[not a link](/foo) +\`not code` +1\. not a list +\* not a list +\# not a heading +\[foo]: /url "not a reference" +\ö not a character entity +"##; + let expected = r##"

*not emphasized* +<br/> not a tag +[not a link](/foo) +`not code` +1. not a list +* not a list +# not a heading +[foo]: /url "not a reference" +&ouml; not a character entity

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_301() { + let original = r##"\\*emphasis* +"##; + let expected = r##"

\emphasis

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_302() { + let original = r##"foo\ +bar +"##; + let expected = r##"

foo
+bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_303() { + let original = r##"`` \[\` `` +"##; + let expected = r##"

\[\`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_304() { + let original = r##" \[\] +"##; + let expected = r##"
\[\]
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_305() { + let original = r##"~~~ +\[\] +~~~ +"##; + let expected = r##"
\[\]
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_306() { + let original = r##" +"##; + let expected = r##"

http://example.com?find=\*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_307() { + let original = r##" +"##; + let expected = r##" +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_308() { + let original = r##"[foo](/bar\* "ti\*tle") +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_309() { + let original = r##"[foo] + +[foo]: /bar\* "ti\*tle" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_310() { + let original = r##"``` foo\+bar +foo +``` +"##; + let expected = r##"
foo
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_311() { + let original = r##"  & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸ +"##; + let expected = r##"

  & © Æ Ď +¾ ℋ ⅆ +∲ ≧̸

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_312() { + let original = r##"# Ӓ Ϡ � +"##; + let expected = r##"

# Ӓ Ϡ �

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_313() { + let original = r##"" ആ ಫ +"##; + let expected = r##"

" ആ ಫ

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_314() { + let original = r##"  &x; &#; &#x; +� +&#abcdef0; +&ThisIsNotDefined; &hi?; +"##; + let expected = r##"

&nbsp &x; &#; &#x; +&#87654321; +&#abcdef0; +&ThisIsNotDefined; &hi?;

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_315() { + let original = r##"© +"##; + let expected = r##"

&copy

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_316() { + let original = r##"&MadeUpEntity; +"##; + let expected = r##"

&MadeUpEntity;

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_317() { + let original = r##" +"##; + let expected = r##" +"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_318() { + let original = r##"[foo](/föö "föö") +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_319() { + let original = r##"[foo] + +[foo]: /föö "föö" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_320() { + let original = r##"``` föö +foo +``` +"##; + let expected = r##"
foo
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_321() { + let original = r##"`föö` +"##; + let expected = r##"

f&ouml;&ouml;

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_322() { + let original = r##" föfö +"##; + let expected = r##"
f&ouml;f&ouml;
+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_323() { + let original = r##"*foo* +*foo* +"##; + let expected = r##"

*foo* +foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_324() { + let original = r##"* foo + +* foo +"##; + let expected = r##"

* foo

+
    +
  • foo
  • +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_325() { + let original = r##"foo bar +"##; + let expected = r##"

foo + +bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_326() { + let original = r##" foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_327() { + let original = r##"[a](url "tit") +"##; + let expected = r##"

[a](url "tit")

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_328() { + let original = r##"`foo` +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_329() { + let original = r##"`` foo ` bar `` +"##; + let expected = r##"

foo ` bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_330() { + let original = r##"` `` ` +"##; + let expected = r##"

``

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_331() { + let original = r##"` `` ` +"##; + let expected = r##"

``

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_332() { + let original = r##"` a` +"##; + let expected = r##"

a

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_333() { + let original = r##"` b ` +"##; + let expected = r##"

 b 

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_334() { + let original = r##"` ` +` ` +"##; + let expected = r##"

  +

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_335() { + let original = r##"`` +foo +bar +baz +`` +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_336() { + let original = r##"`` +foo +`` +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_337() { + let original = r##"`foo bar +baz` +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_338() { + let original = r##"`foo\`bar` +"##; + let expected = r##"

foo\bar`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_339() { + let original = r##"``foo`bar`` +"##; + let expected = r##"

foo`bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_340() { + let original = r##"` foo `` bar ` +"##; + let expected = r##"

foo `` bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_341() { + let original = r##"*foo`*` +"##; + let expected = r##"

*foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_342() { + let original = r##"[not a `link](/foo`) +"##; + let expected = r##"

[not a link](/foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_343() { + let original = r##"`` +"##; + let expected = r##"

<a href="">`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_344() { + let original = r##"
` +"##; + let expected = r##"

`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_345() { + let original = r##"`` +"##; + let expected = r##"

<http://foo.bar.baz>`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_346() { + let original = r##"` +"##; + let expected = r##"

http://foo.bar.`baz`

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_347() { + let original = r##"```foo`` +"##; + let expected = r##"

```foo``

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_348() { + let original = r##"`foo +"##; + let expected = r##"

`foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_349() { + let original = r##"`foo``bar`` +"##; + let expected = r##"

`foobar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_350() { + let original = r##"*foo bar* +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_351() { + let original = r##"a * foo bar* +"##; + let expected = r##"

a * foo bar*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_352() { + let original = r##"a*"foo"* +"##; + let expected = r##"

a*"foo"*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_353() { + let original = r##"* a * +"##; + let expected = r##"

* a *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_354() { + let original = r##"foo*bar* +"##; + let expected = r##"

foobar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_355() { + let original = r##"5*6*78 +"##; + let expected = r##"

5678

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_356() { + let original = r##"_foo bar_ +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_357() { + let original = r##"_ foo bar_ +"##; + let expected = r##"

_ foo bar_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_358() { + let original = r##"a_"foo"_ +"##; + let expected = r##"

a_"foo"_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_359() { + let original = r##"foo_bar_ +"##; + let expected = r##"

foo_bar_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_360() { + let original = r##"5_6_78 +"##; + let expected = r##"

5_6_78

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_361() { + let original = r##"пристаням_стремятся_ +"##; + let expected = r##"

пристаням_стремятся_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_362() { + let original = r##"aa_"bb"_cc +"##; + let expected = r##"

aa_"bb"_cc

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_363() { + let original = r##"foo-_(bar)_ +"##; + let expected = r##"

foo-(bar)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_364() { + let original = r##"_foo* +"##; + let expected = r##"

_foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_365() { + let original = r##"*foo bar * +"##; + let expected = r##"

*foo bar *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_366() { + let original = r##"*foo bar +* +"##; + let expected = r##"

*foo bar +*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_367() { + let original = r##"*(*foo) +"##; + let expected = r##"

*(*foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_368() { + let original = r##"*(*foo*)* +"##; + let expected = r##"

(foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_369() { + let original = r##"*foo*bar +"##; + let expected = r##"

foobar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_370() { + let original = r##"_foo bar _ +"##; + let expected = r##"

_foo bar _

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_371() { + let original = r##"_(_foo) +"##; + let expected = r##"

_(_foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_372() { + let original = r##"_(_foo_)_ +"##; + let expected = r##"

(foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_373() { + let original = r##"_foo_bar +"##; + let expected = r##"

_foo_bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_374() { + let original = r##"_пристаням_стремятся +"##; + let expected = r##"

_пристаням_стремятся

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_375() { + let original = r##"_foo_bar_baz_ +"##; + let expected = r##"

foo_bar_baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_376() { + let original = r##"_(bar)_. +"##; + let expected = r##"

(bar).

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_377() { + let original = r##"**foo bar** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_378() { + let original = r##"** foo bar** +"##; + let expected = r##"

** foo bar**

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_379() { + let original = r##"a**"foo"** +"##; + let expected = r##"

a**"foo"**

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_380() { + let original = r##"foo**bar** +"##; + let expected = r##"

foobar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_381() { + let original = r##"__foo bar__ +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_382() { + let original = r##"__ foo bar__ +"##; + let expected = r##"

__ foo bar__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_383() { + let original = r##"__ +foo bar__ +"##; + let expected = r##"

__ +foo bar__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_384() { + let original = r##"a__"foo"__ +"##; + let expected = r##"

a__"foo"__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_385() { + let original = r##"foo__bar__ +"##; + let expected = r##"

foo__bar__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_386() { + let original = r##"5__6__78 +"##; + let expected = r##"

5__6__78

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_387() { + let original = r##"пристаням__стремятся__ +"##; + let expected = r##"

пристаням__стремятся__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_388() { + let original = r##"__foo, __bar__, baz__ +"##; + let expected = r##"

foo, bar, baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_389() { + let original = r##"foo-__(bar)__ +"##; + let expected = r##"

foo-(bar)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_390() { + let original = r##"**foo bar ** +"##; + let expected = r##"

**foo bar **

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_391() { + let original = r##"**(**foo) +"##; + let expected = r##"

**(**foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_392() { + let original = r##"*(**foo**)* +"##; + let expected = r##"

(foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_393() { + let original = r##"**Gomphocarpus (*Gomphocarpus physocarpus*, syn. +*Asclepias physocarpa*)** +"##; + let expected = r##"

Gomphocarpus (Gomphocarpus physocarpus, syn. +Asclepias physocarpa)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_394() { + let original = r##"**foo "*bar*" foo** +"##; + let expected = r##"

foo "bar" foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_395() { + let original = r##"**foo**bar +"##; + let expected = r##"

foobar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_396() { + let original = r##"__foo bar __ +"##; + let expected = r##"

__foo bar __

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_397() { + let original = r##"__(__foo) +"##; + let expected = r##"

__(__foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_398() { + let original = r##"_(__foo__)_ +"##; + let expected = r##"

(foo)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_399() { + let original = r##"__foo__bar +"##; + let expected = r##"

__foo__bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_400() { + let original = r##"__пристаням__стремятся +"##; + let expected = r##"

__пристаням__стремятся

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_401() { + let original = r##"__foo__bar__baz__ +"##; + let expected = r##"

foo__bar__baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_402() { + let original = r##"__(bar)__. +"##; + let expected = r##"

(bar).

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_403() { + let original = r##"*foo [bar](/url)* +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_404() { + let original = r##"*foo +bar* +"##; + let expected = r##"

foo +bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_405() { + let original = r##"_foo __bar__ baz_ +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_406() { + let original = r##"_foo _bar_ baz_ +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_407() { + let original = r##"__foo_ bar_ +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_408() { + let original = r##"*foo *bar** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_409() { + let original = r##"*foo **bar** baz* +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_410() { + let original = r##"*foo**bar**baz* +"##; + let expected = r##"

foobarbaz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_411() { + let original = r##"*foo**bar* +"##; + let expected = r##"

foo**bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_412() { + let original = r##"***foo** bar* +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_413() { + let original = r##"*foo **bar*** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_414() { + let original = r##"*foo**bar*** +"##; + let expected = r##"

foobar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_415() { + let original = r##"foo***bar***baz +"##; + let expected = r##"

foobarbaz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_416() { + let original = r##"foo******bar*********baz +"##; + let expected = r##"

foobar***baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_417() { + let original = r##"*foo **bar *baz* bim** bop* +"##; + let expected = r##"

foo bar baz bim bop

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_418() { + let original = r##"*foo [*bar*](/url)* +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_419() { + let original = r##"** is not an empty emphasis +"##; + let expected = r##"

** is not an empty emphasis

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_420() { + let original = r##"**** is not an empty strong emphasis +"##; + let expected = r##"

**** is not an empty strong emphasis

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_421() { + let original = r##"**foo [bar](/url)** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_422() { + let original = r##"**foo +bar** +"##; + let expected = r##"

foo +bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_423() { + let original = r##"__foo _bar_ baz__ +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_424() { + let original = r##"__foo __bar__ baz__ +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_425() { + let original = r##"____foo__ bar__ +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_426() { + let original = r##"**foo **bar**** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_427() { + let original = r##"**foo *bar* baz** +"##; + let expected = r##"

foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_428() { + let original = r##"**foo*bar*baz** +"##; + let expected = r##"

foobarbaz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_429() { + let original = r##"***foo* bar** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_430() { + let original = r##"**foo *bar*** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_431() { + let original = r##"**foo *bar **baz** +bim* bop** +"##; + let expected = r##"

foo bar baz +bim bop

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_432() { + let original = r##"**foo [*bar*](/url)** +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_433() { + let original = r##"__ is not an empty emphasis +"##; + let expected = r##"

__ is not an empty emphasis

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_434() { + let original = r##"____ is not an empty strong emphasis +"##; + let expected = r##"

____ is not an empty strong emphasis

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_435() { + let original = r##"foo *** +"##; + let expected = r##"

foo ***

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_436() { + let original = r##"foo *\** +"##; + let expected = r##"

foo *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_437() { + let original = r##"foo *_* +"##; + let expected = r##"

foo _

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_438() { + let original = r##"foo ***** +"##; + let expected = r##"

foo *****

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_439() { + let original = r##"foo **\*** +"##; + let expected = r##"

foo *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_440() { + let original = r##"foo **_** +"##; + let expected = r##"

foo _

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_441() { + let original = r##"**foo* +"##; + let expected = r##"

*foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_442() { + let original = r##"*foo** +"##; + let expected = r##"

foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_443() { + let original = r##"***foo** +"##; + let expected = r##"

*foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_444() { + let original = r##"****foo* +"##; + let expected = r##"

***foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_445() { + let original = r##"**foo*** +"##; + let expected = r##"

foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_446() { + let original = r##"*foo**** +"##; + let expected = r##"

foo***

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_447() { + let original = r##"foo ___ +"##; + let expected = r##"

foo ___

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_448() { + let original = r##"foo _\__ +"##; + let expected = r##"

foo _

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_449() { + let original = r##"foo _*_ +"##; + let expected = r##"

foo *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_450() { + let original = r##"foo _____ +"##; + let expected = r##"

foo _____

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_451() { + let original = r##"foo __\___ +"##; + let expected = r##"

foo _

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_452() { + let original = r##"foo __*__ +"##; + let expected = r##"

foo *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_453() { + let original = r##"__foo_ +"##; + let expected = r##"

_foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_454() { + let original = r##"_foo__ +"##; + let expected = r##"

foo_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_455() { + let original = r##"___foo__ +"##; + let expected = r##"

_foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_456() { + let original = r##"____foo_ +"##; + let expected = r##"

___foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_457() { + let original = r##"__foo___ +"##; + let expected = r##"

foo_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_458() { + let original = r##"_foo____ +"##; + let expected = r##"

foo___

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_459() { + let original = r##"**foo** +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_460() { + let original = r##"*_foo_* +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_461() { + let original = r##"__foo__ +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_462() { + let original = r##"_*foo*_ +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_463() { + let original = r##"****foo**** +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_464() { + let original = r##"____foo____ +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_465() { + let original = r##"******foo****** +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_466() { + let original = r##"***foo*** +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_467() { + let original = r##"_____foo_____ +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_468() { + let original = r##"*foo _bar* baz_ +"##; + let expected = r##"

foo _bar baz_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_469() { + let original = r##"*foo __bar *baz bim__ bam* +"##; + let expected = r##"

foo bar *baz bim bam

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_470() { + let original = r##"**foo **bar baz** +"##; + let expected = r##"

**foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_471() { + let original = r##"*foo *bar baz* +"##; + let expected = r##"

*foo bar baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_472() { + let original = r##"*[bar*](/url) +"##; + let expected = r##"

*bar*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_473() { + let original = r##"_foo [bar_](/url) +"##; + let expected = r##"

_foo bar_

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_474() { + let original = r##"* +"##; + let expected = r##"

*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_475() { + let original = r##"** +"##; + let expected = r##"

**

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_476() { + let original = r##"__ +"##; + let expected = r##"

__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_477() { + let original = r##"*a `*`* +"##; + let expected = r##"

a *

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_478() { + let original = r##"_a `_`_ +"##; + let expected = r##"

a _

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_479() { + let original = r##"**a +"##; + let expected = r##"

**ahttp://foo.bar/?q=**

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_480() { + let original = r##"__a +"##; + let expected = r##"

__ahttp://foo.bar/?q=__

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_481() { + let original = r##"[link](/uri "title") +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_482() { + let original = r##"[link](/uri) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_483() { + let original = r##"[link]() +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_484() { + let original = r##"[link](<>) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_485() { + let original = r##"[link](/my uri) +"##; + let expected = r##"

[link](/my uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_486() { + let original = r##"[link](
) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_487() { + let original = r##"[link](foo +bar) +"##; + let expected = r##"

[link](foo +bar)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_488() { + let original = r##"[link]() +"##; + let expected = r##"

[link]()

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_489() { + let original = r##"[a]() +"##; + let expected = r##"

a

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_490() { + let original = r##"[link]() +"##; + let expected = r##"

[link](<foo>)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_491() { + let original = r##"[a]( +[a](c) +"##; + let expected = r##"

[a](<b)c +[a](<b)c> +[a](c)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_492() { + let original = r##"[link](\(foo\)) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_493() { + let original = r##"[link](foo(and(bar))) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_494() { + let original = r##"[link](foo\(and\(bar\)) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_495() { + let original = r##"[link]() +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_496() { + let original = r##"[link](foo\)\:) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_497() { + let original = r##"[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=3#frag) +"##; + let expected = r##"

link

+

link

+

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_498() { + let original = r##"[link](foo\bar) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_499() { + let original = r##"[link](foo%20bä) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_500() { + let original = r##"[link]("title") +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_501() { + let original = r##"[link](/url "title") +[link](/url 'title') +[link](/url (title)) +"##; + let expected = r##"

link +link +link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_502() { + let original = r##"[link](/url "title \""") +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_503() { + let original = r##"[link](/url "title") +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_504() { + let original = r##"[link](/url "title "and" title") +"##; + let expected = r##"

[link](/url "title "and" title")

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_505() { + let original = r##"[link](/url 'title "and" title') +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_506() { + let original = r##"[link]( /uri + "title" ) +"##; + let expected = r##"

link

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_507() { + let original = r##"[link] (/uri) +"##; + let expected = r##"

[link] (/uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_508() { + let original = r##"[link [foo [bar]]](/uri) +"##; + let expected = r##"

link [foo [bar]]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_509() { + let original = r##"[link] bar](/uri) +"##; + let expected = r##"

[link] bar](/uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_510() { + let original = r##"[link [bar](/uri) +"##; + let expected = r##"

[link bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_511() { + let original = r##"[link \[bar](/uri) +"##; + let expected = r##"

link [bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_512() { + let original = r##"[link *foo **bar** `#`*](/uri) +"##; + let expected = r##"

link foo bar #

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_513() { + let original = r##"[![moon](moon.jpg)](/uri) +"##; + let expected = r##"

moon

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_514() { + let original = r##"[foo [bar](/uri)](/uri) +"##; + let expected = r##"

[foo bar](/uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_515() { + let original = r##"[foo *[bar [baz](/uri)](/uri)*](/uri) +"##; + let expected = r##"

[foo [bar baz](/uri)](/uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_516() { + let original = r##"![[[foo](uri1)](uri2)](uri3) +"##; + let expected = r##"

[foo](uri2)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_517() { + let original = r##"*[foo*](/uri) +"##; + let expected = r##"

*foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_518() { + let original = r##"[foo *bar](baz*) +"##; + let expected = r##"

foo *bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_519() { + let original = r##"*foo [bar* baz] +"##; + let expected = r##"

foo [bar baz]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_520() { + let original = r##"[foo +"##; + let expected = r##"

[foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_521() { + let original = r##"[foo`](/uri)` +"##; + let expected = r##"

[foo](/uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_522() { + let original = r##"[foo +"##; + let expected = r##"

[foohttp://example.com/?search=](uri)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_523() { + let original = r##"[foo][bar] + +[bar]: /url "title" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_524() { + let original = r##"[link [foo [bar]]][ref] + +[ref]: /uri +"##; + let expected = r##"

link [foo [bar]]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_525() { + let original = r##"[link \[bar][ref] + +[ref]: /uri +"##; + let expected = r##"

link [bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_526() { + let original = r##"[link *foo **bar** `#`*][ref] + +[ref]: /uri +"##; + let expected = r##"

link foo bar #

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_527() { + let original = r##"[![moon](moon.jpg)][ref] + +[ref]: /uri +"##; + let expected = r##"

moon

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_528() { + let original = r##"[foo [bar](/uri)][ref] + +[ref]: /uri +"##; + let expected = r##"

[foo bar]ref

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_529() { + let original = r##"[foo *bar [baz][ref]*][ref] + +[ref]: /uri +"##; + let expected = r##"

[foo bar baz]ref

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_530() { + let original = r##"*[foo*][ref] + +[ref]: /uri +"##; + let expected = r##"

*foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_531() { + let original = r##"[foo *bar][ref] + +[ref]: /uri +"##; + let expected = r##"

foo *bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_532() { + let original = r##"[foo + +[ref]: /uri +"##; + let expected = r##"

[foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_533() { + let original = r##"[foo`][ref]` + +[ref]: /uri +"##; + let expected = r##"

[foo][ref]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_534() { + let original = r##"[foo + +[ref]: /uri +"##; + let expected = r##"

[foohttp://example.com/?search=][ref]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_535() { + let original = r##"[foo][BaR] + +[bar]: /url "title" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_536() { + let original = r##"[Толпой][Толпой] is a Russian word. + +[ТОЛПОЙ]: /url +"##; + let expected = r##"

Толпой is a Russian word.

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_537() { + let original = r##"[Foo + bar]: /url + +[Baz][Foo bar] +"##; + let expected = r##"

Baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_538() { + let original = r##"[foo] [bar] + +[bar]: /url "title" +"##; + let expected = r##"

[foo] bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_539() { + let original = r##"[foo] +[bar] + +[bar]: /url "title" +"##; + let expected = r##"

[foo] +bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_540() { + let original = r##"[foo]: /url1 + +[foo]: /url2 + +[bar][foo] +"##; + let expected = r##"

bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_541() { + let original = r##"[bar][foo\!] + +[foo!]: /url +"##; + let expected = r##"

[bar][foo!]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_542() { + let original = r##"[foo][ref[] + +[ref[]: /uri +"##; + let expected = r##"

[foo][ref[]

+

[ref[]: /uri

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_543() { + let original = r##"[foo][ref[bar]] + +[ref[bar]]: /uri +"##; + let expected = r##"

[foo][ref[bar]]

+

[ref[bar]]: /uri

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_544() { + let original = r##"[[[foo]]] + +[[[foo]]]: /url +"##; + let expected = r##"

[[[foo]]]

+

[[[foo]]]: /url

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_545() { + let original = r##"[foo][ref\[] + +[ref\[]: /uri +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_546() { + let original = r##"[bar\\]: /uri + +[bar\\] +"##; + let expected = r##"

bar\

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_547() { + let original = r##"[] + +[]: /uri +"##; + let expected = r##"

[]

+

[]: /uri

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_548() { + let original = r##"[ + ] + +[ + ]: /uri +"##; + let expected = r##"

[ +]

+

[ +]: /uri

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_549() { + let original = r##"[foo][] + +[foo]: /url "title" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_550() { + let original = r##"[*foo* bar][] + +[*foo* bar]: /url "title" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_551() { + let original = r##"[Foo][] + +[foo]: /url "title" +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_552() { + let original = r##"[foo] +[] + +[foo]: /url "title" +"##; + let expected = r##"

foo +[]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_553() { + let original = r##"[foo] + +[foo]: /url "title" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_554() { + let original = r##"[*foo* bar] + +[*foo* bar]: /url "title" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_555() { + let original = r##"[[*foo* bar]] + +[*foo* bar]: /url "title" +"##; + let expected = r##"

[foo bar]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_556() { + let original = r##"[[bar [foo] + +[foo]: /url +"##; + let expected = r##"

[[bar foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_557() { + let original = r##"[Foo] + +[foo]: /url "title" +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_558() { + let original = r##"[foo] bar + +[foo]: /url +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_559() { + let original = r##"\[foo] + +[foo]: /url "title" +"##; + let expected = r##"

[foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_560() { + let original = r##"[foo*]: /url + +*[foo*] +"##; + let expected = r##"

*foo*

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_561() { + let original = r##"[foo][bar] + +[foo]: /url1 +[bar]: /url2 +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_562() { + let original = r##"[foo][] + +[foo]: /url1 +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_563() { + let original = r##"[foo]() + +[foo]: /url1 +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_564() { + let original = r##"[foo](not a link) + +[foo]: /url1 +"##; + let expected = r##"

foo(not a link)

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_565() { + let original = r##"[foo][bar][baz] + +[baz]: /url +"##; + let expected = r##"

[foo]bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_566() { + let original = r##"[foo][bar][baz] + +[baz]: /url1 +[bar]: /url2 +"##; + let expected = r##"

foobaz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_567() { + let original = r##"[foo][bar][baz] + +[baz]: /url1 +[foo]: /url2 +"##; + let expected = r##"

[foo]bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_568() { + let original = r##"![foo](/url "title") +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_569() { + let original = r##"![foo *bar*] + +[foo *bar*]: train.jpg "train & tracks" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_570() { + let original = r##"![foo ![bar](/url)](/url2) +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_571() { + let original = r##"![foo [bar](/url)](/url2) +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_572() { + let original = r##"![foo *bar*][] + +[foo *bar*]: train.jpg "train & tracks" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_573() { + let original = r##"![foo *bar*][foobar] + +[FOOBAR]: train.jpg "train & tracks" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_574() { + let original = r##"![foo](train.jpg) +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_575() { + let original = r##"My ![foo bar](/path/to/train.jpg "title" ) +"##; + let expected = r##"

My foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_576() { + let original = r##"![foo]() +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_577() { + let original = r##"![](/url) +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_578() { + let original = r##"![foo][bar] + +[bar]: /url +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_579() { + let original = r##"![foo][bar] + +[BAR]: /url +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_580() { + let original = r##"![foo][] + +[foo]: /url "title" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_581() { + let original = r##"![*foo* bar][] + +[*foo* bar]: /url "title" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_582() { + let original = r##"![Foo][] + +[foo]: /url "title" +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_583() { + let original = r##"![foo] +[] + +[foo]: /url "title" +"##; + let expected = r##"

foo +[]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_584() { + let original = r##"![foo] + +[foo]: /url "title" +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_585() { + let original = r##"![*foo* bar] + +[*foo* bar]: /url "title" +"##; + let expected = r##"

foo bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_586() { + let original = r##"![[foo]] + +[[foo]]: /url "title" +"##; + let expected = r##"

![[foo]]

+

[[foo]]: /url "title"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_587() { + let original = r##"![Foo] + +[foo]: /url "title" +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_588() { + let original = r##"!\[foo] + +[foo]: /url "title" +"##; + let expected = r##"

![foo]

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_589() { + let original = r##"\![foo] + +[foo]: /url "title" +"##; + let expected = r##"

!foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_590() { + let original = r##" +"##; + let expected = r##"

http://foo.bar.baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_591() { + let original = r##" +"##; + let expected = r##"

http://foo.bar.baz/test?q=hello&id=22&boolean

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_592() { + let original = r##" +"##; + let expected = r##"

irc://foo.bar:2233/baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_593() { + let original = r##" +"##; + let expected = r##"

MAILTO:FOO@BAR.BAZ

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_594() { + let original = r##" +"##; + let expected = r##"

a+b+c:d

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_595() { + let original = r##" +"##; + let expected = r##"

made-up-scheme://foo,bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_596() { + let original = r##" +"##; + let expected = r##"

http://../

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_597() { + let original = r##" +"##; + let expected = r##"

localhost:5001/foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_598() { + let original = r##" +"##; + let expected = r##"

<http://foo.bar/baz bim>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_599() { + let original = r##" +"##; + let expected = r##"

http://example.com/\[\

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_600() { + let original = r##" +"##; + let expected = r##"

foo@bar.example.com

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_601() { + let original = r##" +"##; + let expected = r##"

foo+special@Bar.baz-bar0.com

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_602() { + let original = r##" +"##; + let expected = r##"

<foo+@bar.example.com>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_603() { + let original = r##"<> +"##; + let expected = r##"

<>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_604() { + let original = r##"< http://foo.bar > +"##; + let expected = r##"

< http://foo.bar >

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_605() { + let original = r##" +"##; + let expected = r##"

<m:abc>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_606() { + let original = r##" +"##; + let expected = r##"

<foo.bar.baz>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_607() { + let original = r##"http://example.com +"##; + let expected = r##"

http://example.com

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_608() { + let original = r##"foo@bar.example.com +"##; + let expected = r##"

foo@bar.example.com

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_609() { + let original = r##" +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_610() { + let original = r##" +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_611() { + let original = r##" +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_612() { + let original = r##" +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_613() { + let original = r##"Foo +"##; + let expected = r##"

Foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_614() { + let original = r##"<33> <__> +"##; + let expected = r##"

<33> <__>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_615() { + let original = r##"
+"##; + let expected = r##"

<a h*#ref="hi">

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_616() { + let original = r##"
<a href="hi'> <a href=hi'>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_617() { + let original = r##"< a>< +foo> + +"##; + let expected = r##"

< a>< +foo><bar/ > +<foo bar=baz +bim!bop />

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_618() { + let original = r##"
+"##; + let expected = r##"

<a href='bar'title=title>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_619() { + let original = r##"
+"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_620() { + let original = r##" +"##; + let expected = r##"

</a href="foo">

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_621() { + let original = r##"foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_622() { + let original = r##"foo +"##; + let expected = r##"

foo <!-- not a comment -- two hyphens -->

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_623() { + let original = r##"foo foo --> + +foo +"##; + let expected = r##"

foo <!--> foo -->

+

foo <!-- foo--->

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_624() { + let original = r##"foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_625() { + let original = r##"foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_626() { + let original = r##"foo &<]]> +"##; + let expected = r##"

foo &<]]>

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_627() { + let original = r##"foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_628() { + let original = r##"foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_629() { + let original = r##" +"##; + let expected = r##"

<a href=""">

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_630() { + let original = r##"foo +baz +"##; + let expected = r##"

foo
+baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_631() { + let original = r##"foo\ +baz +"##; + let expected = r##"

foo
+baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_632() { + let original = r##"foo +baz +"##; + let expected = r##"

foo
+baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_633() { + let original = r##"foo + bar +"##; + let expected = r##"

foo
+bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_634() { + let original = r##"foo\ + bar +"##; + let expected = r##"

foo
+bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_635() { + let original = r##"*foo +bar* +"##; + let expected = r##"

foo
+bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_636() { + let original = r##"*foo\ +bar* +"##; + let expected = r##"

foo
+bar

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_637() { + let original = r##"`code +span` +"##; + let expected = r##"

code span

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_638() { + let original = r##"`code\ +span` +"##; + let expected = r##"

code\ span

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_639() { + let original = r##"
+"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_640() { + let original = r##" +"##; + let expected = r##"

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_641() { + let original = r##"foo\ +"##; + let expected = r##"

foo\

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_642() { + let original = r##"foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_643() { + let original = r##"### foo\ +"##; + let expected = r##"

foo\

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_644() { + let original = r##"### foo +"##; + let expected = r##"

foo

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_645() { + let original = r##"foo +baz +"##; + let expected = r##"

foo +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_646() { + let original = r##"foo + baz +"##; + let expected = r##"

foo +baz

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_647() { + let original = r##"hello $.;'there +"##; + let expected = r##"

hello $.;'there

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_648() { + let original = r##"Foo χρῆν +"##; + let expected = r##"

Foo χρῆν

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn spec_test_649() { + let original = r##"Multiple spaces +"##; + let expected = r##"

Multiple spaces

+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/suite/table.rs rust-pulldown-cmark-0.8.0/tests/suite/table.rs --- rust-pulldown-cmark-0.2.0/tests/suite/table.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/suite/table.rs 2020-09-01 15:22:39.000000000 +0000 @@ -0,0 +1,205 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn table_test_1() { + let original = r##"Test header +----------- +"##; + let expected = r##"

Test header

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_2() { + let original = r##"Test|Table +----|----- +"##; + let expected = r##" +
TestTable
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_3() { + let original = r##"> Test | Table +> ------|------ +> Row 1 | Every +> Row 2 | Day +> +> Paragraph +"##; + let expected = r##"
+ + + +
Test Table
Row 1 Every
Row 2 Day
+

Paragraph

+
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_4() { + let original = r##" 1. First entry + 2. Second entry + + Col 1|Col 2 + -|- + Row 1|Part 2 + Row 2|Part 2 +"##; + let expected = r##"
    +
  1. +

    First entry

    +
  2. +
  3. +

    Second entry

    + + + +
    Col 1Col 2
    Row 1Part 2
    Row 2Part 2
    +
  4. +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_5() { + let original = r##"|Col 1|Col 2| +|-----|-----| +|R1C1 |R1C2 | +|R2C1 |R2C2 | +"##; + let expected = r##" + + +
Col 1Col 2
R1C1 R1C2
R2C1 R2C2
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_6() { + let original = r##"| Col 1 | Col 2 | +|-------|-------| +| | | +| | | +"##; + let expected = r##" + + +
Col 1 Col 2
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_7() { + let original = r##"| Col 1 | Col 2 | +|-------|-------| +| x | | +| | x | +"##; + let expected = r##" + + +
Col 1 Col 2
x
x
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_8() { + let original = r##"|Col 1|Col 2| +|-----|-----| +|✓ |✓ | +|✓ |✓ | +"##; + let expected = r##" + + +
Col 1Col 2
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_9() { + let original = r##"| Target | std |rustc|cargo| notes | +|-------------------------------|-----|-----|-----|----------------------------| +| `x86_64-unknown-linux-musl` | ✓ | | | 64-bit Linux with MUSL | +| `arm-linux-androideabi` | ✓ | | | ARM Android | +| `arm-unknown-linux-gnueabi` | ✓ | ✓ | | ARM Linux (2.6.18+) | +| `arm-unknown-linux-gnueabihf` | ✓ | ✓ | | ARM Linux (2.6.18+) | +| `aarch64-unknown-linux-gnu` | ✓ | | | ARM64 Linux (2.6.18+) | +| `mips-unknown-linux-gnu` | ✓ | | | MIPS Linux (2.6.18+) | +| `mipsel-unknown-linux-gnu` | ✓ | | | MIPS (LE) Linux (2.6.18+) | +"##; + let expected = r##" + + + + + + + +
Target std rustccargo notes
x86_64-unknown-linux-musl 64-bit Linux with MUSL
arm-linux-androideabi ARM Android
arm-unknown-linux-gnueabi ARM Linux (2.6.18+)
arm-unknown-linux-gnueabihf ARM Linux (2.6.18+)
aarch64-unknown-linux-gnu ARM64 Linux (2.6.18+)
mips-unknown-linux-gnu MIPS Linux (2.6.18+)
mipsel-unknown-linux-gnu MIPS (LE) Linux (2.6.18+)
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_10() { + let original = r##"|-|-| +|ぃ|い| +"##; + let expected = r##"

|-|-| +|ぃ|い|

+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_11() { + let original = r##"|ぁ|ぃ| +|-|-| +|ぃ|ぃ| +"##; + let expected = r##" + +
+"##; + + test_markdown_html(original, expected, false); +} + +#[test] +fn table_test_12() { + let original = r##"|Колонка 1|Колонка 2| +|---------|---------| +|Ячейка 1 |Ячейка 2 | +"##; + let expected = r##" + +
Колонка 1Колонка 2
Ячейка 1 Ячейка 2
+"##; + + test_markdown_html(original, expected, false); +} diff -Nru rust-pulldown-cmark-0.2.0/tests/table.rs rust-pulldown-cmark-0.8.0/tests/table.rs --- rust-pulldown-cmark-0.2.0/tests/table.rs 2018-11-07 16:24:27.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tests/table.rs 1970-01-01 00:00:00.000000000 +0000 @@ -1,368 +0,0 @@ -// This file is auto-generated by the build script -// Please, do not modify it manually - -extern crate pulldown_cmark; - - - #[test] - fn table_test_1() { - let original = r##"Test header ------------ -"##; - let expected = r##"

Test header

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_2() { - let original = r##"Test|Table -----|----- -"##; - let expected = r##" -
TestTable
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_3() { - let original = r##"Test|Table -----|----- -Test row -Test|2 - -Test ending -"##; - let expected = r##" - - -
TestTable
Test row
Test2
-

Test ending

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_4() { - let original = r##"> Test | Table -> ------|------ -> Row 1 | Every -> Row 2 | Day -> -> Paragraph -"##; - let expected = r##"
- - - -
Test Table
Row 1 Every
Row 2 Day
-

Paragraph

-
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_5() { - let original = r##" 1. First entry - 2. Second entry - - Col 1|Col 2 - -|- - Row 1|Part 2 - Row 2|Part 2 -"##; - let expected = r##"
    -
  1. -

    First entry

    -
  2. -
  3. -

    Second entry

    - - - -
    Col 1Col 2
    Row 1Part 2
    Row 2Part 2
    -
  4. -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_6() { - let original = r##"|Col 1|Col 2| -|-----|-----| -|R1C1 |R1C2 | -|R2C1 |R2C2 | -"##; - let expected = r##" - - -
Col 1Col 2
R1C1 R1C2
R2C1 R2C2
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_7() { - let original = r##"| Col 1 | Col 2 | -|-------|-------| -| | | -| | | -"##; - let expected = r##" - - -
Col 1 Col 2
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_8() { - let original = r##"| Col 1 | Col 2 | -|-------|-------| -| x | | -| | x | -"##; - let expected = r##" - - -
Col 1 Col 2
x
x
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_9() { - let original = r##"|Col 1|Col 2| -|-----|-----| -|✓ |✓ | -|✓ |✓ | -"##; - let expected = r##" - - -
Col 1Col 2
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_10() { - let original = r##"| Target | std |rustc|cargo| notes | -|-------------------------------|-----|-----|-----|----------------------------| -| `x86_64-unknown-linux-musl` | ✓ | | | 64-bit Linux with MUSL | -| `arm-linux-androideabi` | ✓ | | | ARM Android | -| `arm-unknown-linux-gnueabi` | ✓ | ✓ | | ARM Linux (2.6.18+) | -| `arm-unknown-linux-gnueabihf` | ✓ | ✓ | | ARM Linux (2.6.18+) | -| `aarch64-unknown-linux-gnu` | ✓ | | | ARM64 Linux (2.6.18+) | -| `mips-unknown-linux-gnu` | ✓ | | | MIPS Linux (2.6.18+) | -| `mipsel-unknown-linux-gnu` | ✓ | | | MIPS (LE) Linux (2.6.18+) | -"##; - let expected = r##" - - - - - - - -
Target std rustccargo notes
x86_64-unknown-linux-musl 64-bit Linux with MUSL
arm-linux-androideabi ARM Android
arm-unknown-linux-gnueabi ARM Linux (2.6.18+)
arm-unknown-linux-gnueabihf ARM Linux (2.6.18+)
aarch64-unknown-linux-gnu ARM64 Linux (2.6.18+)
mips-unknown-linux-gnu MIPS Linux (2.6.18+)
mipsel-unknown-linux-gnu MIPS (LE) Linux (2.6.18+)
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_11() { - let original = r##"|-|-| -|ぃ|い| -"##; - let expected = r##"

|-|-| -|ぃ|い|

-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_12() { - let original = r##"|ぁ|ぃ| -|-|-| -|ぃ|ぃ| -"##; - let expected = r##" - -
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } - - #[test] - fn table_test_13() { - let original = r##"|Колонка 1|Колонка 2| -|---------|---------| -|Ячейка 1 |Ячейка 2 | -"##; - let expected = r##" - -
Колонка 1Колонка 2
Ячейка 1 Ячейка 2
-"##; - - use pulldown_cmark::{Parser, html, Options}; - - let mut s = String::new(); - - let mut opts = Options::empty(); - opts.insert(Options::ENABLE_TABLES); - opts.insert(Options::ENABLE_FOOTNOTES); - - let p = Parser::new_ext(&original, opts); - html::push_html(&mut s, p); - - assert_eq!(expected, s); - } \ No newline at end of file diff -Nru rust-pulldown-cmark-0.2.0/third_party/CommonMark/LICENSE rust-pulldown-cmark-0.8.0/third_party/CommonMark/LICENSE --- rust-pulldown-cmark-0.2.0/third_party/CommonMark/LICENSE 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/third_party/CommonMark/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -The CommonMark spec (spec.txt) and DTD (CommonMark.dtd) are - -Copyright (C) 2014-16 John MacFarlane - -Released under the Creative Commons CC-BY-SA 4.0 license: -. - -Creative Commons Attribution-ShareAlike 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. - -Section 1 – Definitions. - -Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. -Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. -BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. -Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. -Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. -Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. -License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. -Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. -Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. -Licensor means the individual(s) or entity(ies) granting rights under this Public License. -Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. -Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. -You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. -Section 2 – Scope. - -License grant. -Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: -reproduce and Share the Licensed Material, in whole or in part; and -produce, reproduce, and Share Adapted Material. -Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. -Term. The term of this Public License is specified in Section 6(a). -Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. -Downstream recipients. -Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. -Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. -No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. -No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). -Other rights. - -Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. -Patent and trademark rights are not licensed under this Public License. -To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. -Section 3 – License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the following conditions. - -Attribution. - -If You Share the Licensed Material (including in modified form), You must: - -retain the following if it is supplied by the Licensor with the Licensed Material: -identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); -a copyright notice; -a notice that refers to this Public License; -a notice that refers to the disclaimer of warranties; -a URI or hyperlink to the Licensed Material to the extent reasonably practicable; -indicate if You modified the Licensed Material and retain an indication of any previous modifications; and -indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. -You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. -If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. -ShareAlike. -In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. - -The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. -You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. -You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. -Section 4 – Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: - -for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; -if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and -You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. -For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. -Section 5 – Disclaimer of Warranties and Limitation of Liability. - -Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. -To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. -The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. -Section 6 – Term and Termination. - -This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. -Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: - -automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or -upon express reinstatement by the Licensor. -For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. -For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. -Sections 1, 5, 6, 7, and 8 survive termination of this Public License. -Section 7 – Other Terms and Conditions. - -The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. -Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. -Section 8 – Interpretation. - -For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. -To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. -No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. -Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. -Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. - -Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff -Nru rust-pulldown-cmark-0.2.0/third_party/CommonMark/README.google rust-pulldown-cmark-0.8.0/third_party/CommonMark/README.google --- rust-pulldown-cmark-0.2.0/third_party/CommonMark/README.google 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/third_party/CommonMark/README.google 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -URL: https://github.com/jgm/CommonMark.git -Version: 1ef46a73e61968a60cc7b2e700381d719165b86c -License: Creative Commons CC-BY-SA 4.0 -License File: LICENSE - -Description: -CommonMark spec - -Local Modifications: -This directory contains only the spec file. License file has been -subsetted to only the files it applies to, and text of CC-BY-SA 4.0 -license has been added. diff -Nru rust-pulldown-cmark-0.2.0/third_party/CommonMark/spec.txt rust-pulldown-cmark-0.8.0/third_party/CommonMark/spec.txt --- rust-pulldown-cmark-0.2.0/third_party/CommonMark/spec.txt 2018-11-07 16:24:07.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/third_party/CommonMark/spec.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9532 +0,0 @@ ---- -title: CommonMark Spec -author: John MacFarlane -version: 0.28 -date: '2017-08-01' -license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)' -... - -# Introduction - -## What is Markdown? - -Markdown is a plain text format for writing structured documents, -based on conventions for indicating formatting in email -and usenet posts. It was developed by John Gruber (with -help from Aaron Swartz) and released in 2004 in the form of a -[syntax description](http://daringfireball.net/projects/markdown/syntax) -and a Perl script (`Markdown.pl`) for converting Markdown to -HTML. In the next decade, dozens of implementations were -developed in many languages. Some extended the original -Markdown syntax with conventions for footnotes, tables, and -other document elements. Some allowed Markdown documents to be -rendered in formats other than HTML. Websites like Reddit, -StackOverflow, and GitHub had millions of people using Markdown. -And Markdown started to be used beyond the web, to author books, -articles, slide shows, letters, and lecture notes. - -What distinguishes Markdown from many other lightweight markup -syntaxes, which are often easier to write, is its readability. -As Gruber writes: - -> The overriding design goal for Markdown's formatting syntax is -> to make it as readable as possible. The idea is that a -> Markdown-formatted document should be publishable as-is, as -> plain text, without looking like it's been marked up with tags -> or formatting instructions. -> () - -The point can be illustrated by comparing a sample of -[AsciiDoc](http://www.methods.co.nz/asciidoc/) with -an equivalent sample of Markdown. Here is a sample of -AsciiDoc from the AsciiDoc manual: - -``` -1. List item one. -+ -List item one continued with a second paragraph followed by an -Indented block. -+ -................. -$ ls *.sh -$ mv *.sh ~/tmp -................. -+ -List item continued with a third paragraph. - -2. List item two continued with an open block. -+ --- -This paragraph is part of the preceding list item. - -a. This list is nested and does not require explicit item -continuation. -+ -This paragraph is part of the preceding list item. - -b. List item b. - -This paragraph belongs to item two of the outer list. --- -``` - -And here is the equivalent in Markdown: -``` -1. List item one. - - List item one continued with a second paragraph followed by an - Indented block. - - $ ls *.sh - $ mv *.sh ~/tmp - - List item continued with a third paragraph. - -2. List item two continued with an open block. - - This paragraph is part of the preceding list item. - - 1. This list is nested and does not require explicit item continuation. - - This paragraph is part of the preceding list item. - - 2. List item b. - - This paragraph belongs to item two of the outer list. -``` - -The AsciiDoc version is, arguably, easier to write. You don't need -to worry about indentation. But the Markdown version is much easier -to read. The nesting of list items is apparent to the eye in the -source, not just in the processed document. - -## Why is a spec needed? - -John Gruber's [canonical description of Markdown's -syntax](http://daringfireball.net/projects/markdown/syntax) -does not specify the syntax unambiguously. Here are some examples of -questions it does not answer: - -1. How much indentation is needed for a sublist? The spec says that - continuation paragraphs need to be indented four spaces, but is - not fully explicit about sublists. It is natural to think that - they, too, must be indented four spaces, but `Markdown.pl` does - not require that. This is hardly a "corner case," and divergences - between implementations on this issue often lead to surprises for - users in real documents. (See [this comment by John - Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).) - -2. Is a blank line needed before a block quote or heading? - Most implementations do not require the blank line. However, - this can lead to unexpected results in hard-wrapped text, and - also to ambiguities in parsing (note that some implementations - put the heading inside the blockquote, while others do not). - (John Gruber has also spoken [in favor of requiring the blank - lines](http://article.gmane.org/gmane.text.markdown.general/2146).) - -3. Is a blank line needed before an indented code block? - (`Markdown.pl` requires it, but this is not mentioned in the - documentation, and some implementations do not require it.) - - ``` markdown - paragraph - code? - ``` - -4. What is the exact rule for determining when list items get - wrapped in `

` tags? Can a list be partially "loose" and partially - "tight"? What should we do with a list like this? - - ``` markdown - 1. one - - 2. two - 3. three - ``` - - Or this? - - ``` markdown - 1. one - - a - - - b - 2. two - ``` - - (There are some relevant comments by John Gruber - [here](http://article.gmane.org/gmane.text.markdown.general/2554).) - -5. Can list markers be indented? Can ordered list markers be right-aligned? - - ``` markdown - 8. item 1 - 9. item 2 - 10. item 2a - ``` - -6. Is this one list with a thematic break in its second item, - or two lists separated by a thematic break? - - ``` markdown - * a - * * * * * - * b - ``` - -7. When list markers change from numbers to bullets, do we have - two lists or one? (The Markdown syntax description suggests two, - but the perl scripts and many other implementations produce one.) - - ``` markdown - 1. fee - 2. fie - - foe - - fum - ``` - -8. What are the precedence rules for the markers of inline structure? - For example, is the following a valid link, or does the code span - take precedence ? - - ``` markdown - [a backtick (`)](/url) and [another backtick (`)](/url). - ``` - -9. What are the precedence rules for markers of emphasis and strong - emphasis? For example, how should the following be parsed? - - ``` markdown - *foo *bar* baz* - ``` - -10. What are the precedence rules between block-level and inline-level - structure? For example, how should the following be parsed? - - ``` markdown - - `a long code span can contain a hyphen like this - - and it can screw things up` - ``` - -11. Can list items include section headings? (`Markdown.pl` does not - allow this, but does allow blockquotes to include headings.) - - ``` markdown - - # Heading - ``` - -12. Can list items be empty? - - ``` markdown - * a - * - * b - ``` - -13. Can link references be defined inside block quotes or list items? - - ``` markdown - > Blockquote [foo]. - > - > [foo]: /url - ``` - -14. If there are multiple definitions for the same reference, which takes - precedence? - - ``` markdown - [foo]: /url1 - [foo]: /url2 - - [foo][] - ``` - -In the absence of a spec, early implementers consulted `Markdown.pl` -to resolve these ambiguities. But `Markdown.pl` was quite buggy, and -gave manifestly bad results in many cases, so it was not a -satisfactory replacement for a spec. - -Because there is no unambiguous spec, implementations have diverged -considerably. As a result, users are often surprised to find that -a document that renders one way on one system (say, a github wiki) -renders differently on another (say, converting to docbook using -pandoc). To make matters worse, because nothing in Markdown counts -as a "syntax error," the divergence often isn't discovered right away. - -## About this document - -This document attempts to specify Markdown syntax unambiguously. -It contains many examples with side-by-side Markdown and -HTML. These are intended to double as conformance tests. An -accompanying script `spec_tests.py` can be used to run the tests -against any Markdown program: - - python test/spec_tests.py --spec spec.txt --program PROGRAM - -Since this document describes how Markdown is to be parsed into -an abstract syntax tree, it would have made sense to use an abstract -representation of the syntax tree instead of HTML. But HTML is capable -of representing the structural distinctions we need to make, and the -choice of HTML for the tests makes it possible to run the tests against -an implementation without writing an abstract syntax tree renderer. - -This document is generated from a text file, `spec.txt`, written -in Markdown with a small extension for the side-by-side tests. -The script `tools/makespec.py` can be used to convert `spec.txt` into -HTML or CommonMark (which can then be converted into other formats). - -In the examples, the `→` character is used to represent tabs. - -# Preliminaries - -## Characters and lines - -Any sequence of [characters] is a valid CommonMark -document. - -A [character](@) is a Unicode code point. Although some -code points (for example, combining accents) do not correspond to -characters in an intuitive sense, all code points count as characters -for purposes of this spec. - -This spec does not specify an encoding; it thinks of lines as composed -of [characters] rather than bytes. A conforming parser may be limited -to a certain encoding. - -A [line](@) is a sequence of zero or more [characters] -other than newline (`U+000A`) or carriage return (`U+000D`), -followed by a [line ending] or by the end of file. - -A [line ending](@) is a newline (`U+000A`), a carriage return -(`U+000D`) not followed by a newline, or a carriage return and a -following newline. - -A line containing no characters, or a line containing only spaces -(`U+0020`) or tabs (`U+0009`), is called a [blank line](@). - -The following definitions of character classes will be used in this spec: - -A [whitespace character](@) is a space -(`U+0020`), tab (`U+0009`), newline (`U+000A`), line tabulation (`U+000B`), -form feed (`U+000C`), or carriage return (`U+000D`). - -[Whitespace](@) is a sequence of one or more [whitespace -characters]. - -A [Unicode whitespace character](@) is -any code point in the Unicode `Zs` general category, or a tab (`U+0009`), -carriage return (`U+000D`), newline (`U+000A`), or form feed -(`U+000C`). - -[Unicode whitespace](@) is a sequence of one -or more [Unicode whitespace characters]. - -A [space](@) is `U+0020`. - -A [non-whitespace character](@) is any character -that is not a [whitespace character]. - -An [ASCII punctuation character](@) -is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, -`*`, `+`, `,`, `-`, `.`, `/`, `:`, `;`, `<`, `=`, `>`, `?`, `@`, -`[`, `\`, `]`, `^`, `_`, `` ` ``, `{`, `|`, `}`, or `~`. - -A [punctuation character](@) is an [ASCII -punctuation character] or anything in -the general Unicode categories `Pc`, `Pd`, `Pe`, `Pf`, `Pi`, `Po`, or `Ps`. - -## Tabs - -Tabs in lines are not expanded to [spaces]. However, -in contexts where whitespace helps to define block structure, -tabs behave as if they were replaced by spaces with a tab stop -of 4 characters. - -Thus, for example, a tab can be used instead of four spaces -in an indented code block. (Note, however, that internal -tabs are passed through as literal tabs, not expanded to -spaces.) - -```````````````````````````````` example -→foo→baz→→bim -. -

foo→baz→→bim
-
-```````````````````````````````` - -```````````````````````````````` example - →foo→baz→→bim -. -
foo→baz→→bim
-
-```````````````````````````````` - -```````````````````````````````` example - a→a - ὐ→a -. -
a→a
-ὐ→a
-
-```````````````````````````````` - -In the following example, a continuation paragraph of a list -item is indented with a tab; this has exactly the same effect -as indentation with four spaces would: - -```````````````````````````````` example - - foo - -→bar -. -
    -
  • -

    foo

    -

    bar

    -
  • -
-```````````````````````````````` - -```````````````````````````````` example -- foo - -→→bar -. -
    -
  • -

    foo

    -
      bar
    -
    -
  • -
-```````````````````````````````` - -Normally the `>` that begins a block quote may be followed -optionally by a space, which is not considered part of the -content. In the following case `>` is followed by a tab, -which is treated as if it were expanded into three spaces. -Since one of these spaces is considered part of the -delimiter, `foo` is considered to be indented six spaces -inside the block quote context, so we get an indented -code block starting with two spaces. - -```````````````````````````````` example ->→→foo -. -
-
  foo
-
-
-```````````````````````````````` - -```````````````````````````````` example --→→foo -. -
    -
  • -
      foo
    -
    -
  • -
-```````````````````````````````` - - -```````````````````````````````` example - foo -→bar -. -
foo
-bar
-
-```````````````````````````````` - -```````````````````````````````` example - - foo - - bar -→ - baz -. -
    -
  • foo -
      -
    • bar -
        -
      • baz
      • -
      -
    • -
    -
  • -
-```````````````````````````````` - -```````````````````````````````` example -#→Foo -. -

Foo

-```````````````````````````````` - -```````````````````````````````` example -*→*→*→ -. -
-```````````````````````````````` - - -## Insecure characters - -For security reasons, the Unicode character `U+0000` must be replaced -with the REPLACEMENT CHARACTER (`U+FFFD`). - -# Blocks and inlines - -We can think of a document as a sequence of -[blocks](@)---structural elements like paragraphs, block -quotations, lists, headings, rules, and code blocks. Some blocks (like -block quotes and list items) contain other blocks; others (like -headings and paragraphs) contain [inline](@) content---text, -links, emphasized text, images, code spans, and so on. - -## Precedence - -Indicators of block structure always take precedence over indicators -of inline structure. So, for example, the following is a list with -two items, not a list with one item containing a code span: - -```````````````````````````````` example -- `one -- two` -. -
    -
  • `one
  • -
  • two`
  • -
-```````````````````````````````` - - -This means that parsing can proceed in two steps: first, the block -structure of the document can be discerned; second, text lines inside -paragraphs, headings, and other block constructs can be parsed for inline -structure. The second step requires information about link reference -definitions that will be available only at the end of the first -step. Note that the first step requires processing lines in sequence, -but the second can be parallelized, since the inline parsing of -one block element does not affect the inline parsing of any other. - -## Container blocks and leaf blocks - -We can divide blocks into two types: -[container blocks](@), -which can contain other blocks, and [leaf blocks](@), -which cannot. - -# Leaf blocks - -This section describes the different kinds of leaf block that make up a -Markdown document. - -## Thematic breaks - -A line consisting of 0-3 spaces of indentation, followed by a sequence -of three or more matching `-`, `_`, or `*` characters, each followed -optionally by any number of spaces or tabs, forms a -[thematic break](@). - -```````````````````````````````` example -*** ---- -___ -. -
-
-
-```````````````````````````````` - - -Wrong characters: - -```````````````````````````````` example -+++ -. -

+++

-```````````````````````````````` - - -```````````````````````````````` example -=== -. -

===

-```````````````````````````````` - - -Not enough characters: - -```````````````````````````````` example --- -** -__ -. -

-- -** -__

-```````````````````````````````` - - -One to three spaces indent are allowed: - -```````````````````````````````` example - *** - *** - *** -. -
-
-
-```````````````````````````````` - - -Four spaces is too many: - -```````````````````````````````` example - *** -. -
***
-
-```````````````````````````````` - - -```````````````````````````````` example -Foo - *** -. -

Foo -***

-```````````````````````````````` - - -More than three characters may be used: - -```````````````````````````````` example -_____________________________________ -. -
-```````````````````````````````` - - -Spaces are allowed between the characters: - -```````````````````````````````` example - - - - -. -
-```````````````````````````````` - - -```````````````````````````````` example - ** * ** * ** * ** -. -
-```````````````````````````````` - - -```````````````````````````````` example -- - - - -. -
-```````````````````````````````` - - -Spaces are allowed at the end: - -```````````````````````````````` example -- - - - -. -
-```````````````````````````````` - - -However, no other characters may occur in the line: - -```````````````````````````````` example -_ _ _ _ a - -a------ - ----a--- -. -

_ _ _ _ a

-

a------

-

---a---

-```````````````````````````````` - - -It is required that all of the [non-whitespace characters] be the same. -So, this is not a thematic break: - -```````````````````````````````` example - *-* -. -

-

-```````````````````````````````` - - -Thematic breaks do not need blank lines before or after: - -```````````````````````````````` example -- foo -*** -- bar -. -
    -
  • foo
  • -
-
-
    -
  • bar
  • -
-```````````````````````````````` - - -Thematic breaks can interrupt a paragraph: - -```````````````````````````````` example -Foo -*** -bar -. -

Foo

-
-

bar

-```````````````````````````````` - - -If a line of dashes that meets the above conditions for being a -thematic break could also be interpreted as the underline of a [setext -heading], the interpretation as a -[setext heading] takes precedence. Thus, for example, -this is a setext heading, not a paragraph followed by a thematic break: - -```````````````````````````````` example -Foo ---- -bar -. -

Foo

-

bar

-```````````````````````````````` - - -When both a thematic break and a list item are possible -interpretations of a line, the thematic break takes precedence: - -```````````````````````````````` example -* Foo -* * * -* Bar -. -
    -
  • Foo
  • -
-
-
    -
  • Bar
  • -
-```````````````````````````````` - - -If you want a thematic break in a list item, use a different bullet: - -```````````````````````````````` example -- Foo -- * * * -. -
    -
  • Foo
  • -
  • -
    -
  • -
-```````````````````````````````` - - -## ATX headings - -An [ATX heading](@) -consists of a string of characters, parsed as inline content, between an -opening sequence of 1--6 unescaped `#` characters and an optional -closing sequence of any number of unescaped `#` characters. -The opening sequence of `#` characters must be followed by a -[space] or by the end of line. The optional closing sequence of `#`s must be -preceded by a [space] and may be followed by spaces only. The opening -`#` character may be indented 0-3 spaces. The raw contents of the -heading are stripped of leading and trailing spaces before being parsed -as inline content. The heading level is equal to the number of `#` -characters in the opening sequence. - -Simple headings: - -```````````````````````````````` example -# foo -## foo -### foo -#### foo -##### foo -###### foo -. -

foo

-

foo

-

foo

-

foo

-
foo
-
foo
-```````````````````````````````` - - -More than six `#` characters is not a heading: - -```````````````````````````````` example -####### foo -. -

####### foo

-```````````````````````````````` - - -At least one space is required between the `#` characters and the -heading's contents, unless the heading is empty. Note that many -implementations currently do not require the space. However, the -space was required by the -[original ATX implementation](http://www.aaronsw.com/2002/atx/atx.py), -and it helps prevent things like the following from being parsed as -headings: - -```````````````````````````````` example -#5 bolt - -#hashtag -. -

#5 bolt

-

#hashtag

-```````````````````````````````` - - -This is not a heading, because the first `#` is escaped: - -```````````````````````````````` example -\## foo -. -

## foo

-```````````````````````````````` - - -Contents are parsed as inlines: - -```````````````````````````````` example -# foo *bar* \*baz\* -. -

foo bar *baz*

-```````````````````````````````` - - -Leading and trailing blanks are ignored in parsing inline content: - -```````````````````````````````` example -# foo -. -

foo

-```````````````````````````````` - - -One to three spaces indentation are allowed: - -```````````````````````````````` example - ### foo - ## foo - # foo -. -

foo

-

foo

-

foo

-```````````````````````````````` - - -Four spaces are too much: - -```````````````````````````````` example - # foo -. -
# foo
-
-```````````````````````````````` - - -```````````````````````````````` example -foo - # bar -. -

foo -# bar

-```````````````````````````````` - - -A closing sequence of `#` characters is optional: - -```````````````````````````````` example -## foo ## - ### bar ### -. -

foo

-

bar

-```````````````````````````````` - - -It need not be the same length as the opening sequence: - -```````````````````````````````` example -# foo ################################## -##### foo ## -. -

foo

-
foo
-```````````````````````````````` - - -Spaces are allowed after the closing sequence: - -```````````````````````````````` example -### foo ### -. -

foo

-```````````````````````````````` - - -A sequence of `#` characters with anything but [spaces] following it -is not a closing sequence, but counts as part of the contents of the -heading: - -```````````````````````````````` example -### foo ### b -. -

foo ### b

-```````````````````````````````` - - -The closing sequence must be preceded by a space: - -```````````````````````````````` example -# foo# -. -

foo#

-```````````````````````````````` - - -Backslash-escaped `#` characters do not count as part -of the closing sequence: - -```````````````````````````````` example -### foo \### -## foo #\## -# foo \# -. -

foo ###

-

foo ###

-

foo #

-```````````````````````````````` - - -ATX headings need not be separated from surrounding content by blank -lines, and they can interrupt paragraphs: - -```````````````````````````````` example -**** -## foo -**** -. -
-

foo

-
-```````````````````````````````` - - -```````````````````````````````` example -Foo bar -# baz -Bar foo -. -

Foo bar

-

baz

-

Bar foo

-```````````````````````````````` - - -ATX headings can be empty: - -```````````````````````````````` example -## -# -### ### -. -

-

-

-```````````````````````````````` - - -## Setext headings - -A [setext heading](@) consists of one or more -lines of text, each containing at least one [non-whitespace -character], with no more than 3 spaces indentation, followed by -a [setext heading underline]. The lines of text must be such -that, were they not followed by the setext heading underline, -they would be interpreted as a paragraph: they cannot be -interpretable as a [code fence], [ATX heading][ATX headings], -[block quote][block quotes], [thematic break][thematic breaks], -[list item][list items], or [HTML block][HTML blocks]. - -A [setext heading underline](@) is a sequence of -`=` characters or a sequence of `-` characters, with no more than 3 -spaces indentation and any number of trailing spaces. If a line -containing a single `-` can be interpreted as an -empty [list items], it should be interpreted this way -and not as a [setext heading underline]. - -The heading is a level 1 heading if `=` characters are used in -the [setext heading underline], and a level 2 heading if `-` -characters are used. The contents of the heading are the result -of parsing the preceding lines of text as CommonMark inline -content. - -In general, a setext heading need not be preceded or followed by a -blank line. However, it cannot interrupt a paragraph, so when a -setext heading comes after a paragraph, a blank line is needed between -them. - -Simple examples: - -```````````````````````````````` example -Foo *bar* -========= - -Foo *bar* ---------- -. -

Foo bar

-

Foo bar

-```````````````````````````````` - - -The content of the header may span more than one line: - -```````````````````````````````` example -Foo *bar -baz* -==== -. -

Foo bar -baz

-```````````````````````````````` - - -The underlining can be any length: - -```````````````````````````````` example -Foo -------------------------- - -Foo -= -. -

Foo

-

Foo

-```````````````````````````````` - - -The heading content can be indented up to three spaces, and need -not line up with the underlining: - -```````````````````````````````` example - Foo ---- - - Foo ------ - - Foo - === -. -

Foo

-

Foo

-

Foo

-```````````````````````````````` - - -Four spaces indent is too much: - -```````````````````````````````` example - Foo - --- - - Foo ---- -. -
Foo
----
-
-Foo
-
-
-```````````````````````````````` - - -The setext heading underline can be indented up to three spaces, and -may have trailing spaces: - -```````````````````````````````` example -Foo - ---- -. -

Foo

-```````````````````````````````` - - -Four spaces is too much: - -```````````````````````````````` example -Foo - --- -. -

Foo ----

-```````````````````````````````` - - -The setext heading underline cannot contain internal spaces: - -```````````````````````````````` example -Foo -= = - -Foo ---- - -. -

Foo -= =

-

Foo

-
-```````````````````````````````` - - -Trailing spaces in the content line do not cause a line break: - -```````````````````````````````` example -Foo ------ -. -

Foo

-```````````````````````````````` - - -Nor does a backslash at the end: - -```````````````````````````````` example -Foo\ ----- -. -

Foo\

-```````````````````````````````` - - -Since indicators of block structure take precedence over -indicators of inline structure, the following are setext headings: - -```````````````````````````````` example -`Foo ----- -` - -
-. -

`Foo

-

`

-

<a title="a lot

-

of dashes"/>

-```````````````````````````````` - - -The setext heading underline cannot be a [lazy continuation -line] in a list item or block quote: - -```````````````````````````````` example -> Foo ---- -. -
-

Foo

-
-
-```````````````````````````````` - - -```````````````````````````````` example -> foo -bar -=== -. -
-

foo -bar -===

-
-```````````````````````````````` - - -```````````````````````````````` example -- Foo ---- -. -
    -
  • Foo
  • -
-
-```````````````````````````````` - - -A blank line is needed between a paragraph and a following -setext heading, since otherwise the paragraph becomes part -of the heading's content: - -```````````````````````````````` example -Foo -Bar ---- -. -

Foo -Bar

-```````````````````````````````` - - -But in general a blank line is not required before or after -setext headings: - -```````````````````````````````` example ---- -Foo ---- -Bar ---- -Baz -. -
-

Foo

-

Bar

-

Baz

-```````````````````````````````` - - -Setext headings cannot be empty: - -```````````````````````````````` example - -==== -. -

====

-```````````````````````````````` - - -Setext heading text lines must not be interpretable as block -constructs other than paragraphs. So, the line of dashes -in these examples gets interpreted as a thematic break: - -```````````````````````````````` example ---- ---- -. -
-
-```````````````````````````````` - - -```````````````````````````````` example -- foo ------ -. -
    -
  • foo
  • -
-
-```````````````````````````````` - - -```````````````````````````````` example - foo ---- -. -
foo
-
-
-```````````````````````````````` - - -```````````````````````````````` example -> foo ------ -. -
-

foo

-
-
-```````````````````````````````` - - -If you want a heading with `> foo` as its literal text, you can -use backslash escapes: - -```````````````````````````````` example -\> foo ------- -. -

> foo

-```````````````````````````````` - - -**Compatibility note:** Most existing Markdown implementations -do not allow the text of setext headings to span multiple lines. -But there is no consensus about how to interpret - -``` markdown -Foo -bar ---- -baz -``` - -One can find four different interpretations: - -1. paragraph "Foo", heading "bar", paragraph "baz" -2. paragraph "Foo bar", thematic break, paragraph "baz" -3. paragraph "Foo bar --- baz" -4. heading "Foo bar", paragraph "baz" - -We find interpretation 4 most natural, and interpretation 4 -increases the expressive power of CommonMark, by allowing -multiline headings. Authors who want interpretation 1 can -put a blank line after the first paragraph: - -```````````````````````````````` example -Foo - -bar ---- -baz -. -

Foo

-

bar

-

baz

-```````````````````````````````` - - -Authors who want interpretation 2 can put blank lines around -the thematic break, - -```````````````````````````````` example -Foo -bar - ---- - -baz -. -

Foo -bar

-
-

baz

-```````````````````````````````` - - -or use a thematic break that cannot count as a [setext heading -underline], such as - -```````````````````````````````` example -Foo -bar -* * * -baz -. -

Foo -bar

-
-

baz

-```````````````````````````````` - - -Authors who want interpretation 3 can use backslash escapes: - -```````````````````````````````` example -Foo -bar -\--- -baz -. -

Foo -bar ---- -baz

-```````````````````````````````` - - -## Indented code blocks - -An [indented code block](@) is composed of one or more -[indented chunks] separated by blank lines. -An [indented chunk](@) is a sequence of non-blank lines, -each indented four or more spaces. The contents of the code block are -the literal contents of the lines, including trailing -[line endings], minus four spaces of indentation. -An indented code block has no [info string]. - -An indented code block cannot interrupt a paragraph, so there must be -a blank line between a paragraph and a following indented code block. -(A blank line is not needed, however, between a code block and a following -paragraph.) - -```````````````````````````````` example - a simple - indented code block -. -
a simple
-  indented code block
-
-```````````````````````````````` - - -If there is any ambiguity between an interpretation of indentation -as a code block and as indicating that material belongs to a [list -item][list items], the list item interpretation takes precedence: - -```````````````````````````````` example - - foo - - bar -. -
    -
  • -

    foo

    -

    bar

    -
  • -
-```````````````````````````````` - - -```````````````````````````````` example -1. foo - - - bar -. -
    -
  1. -

    foo

    -
      -
    • bar
    • -
    -
  2. -
-```````````````````````````````` - - - -The contents of a code block are literal text, and do not get parsed -as Markdown: - -```````````````````````````````` example -
- *hi* - - - one -. -
<a/>
-*hi*
-
-- one
-
-```````````````````````````````` - - -Here we have three chunks separated by blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 - - - - chunk3 -. -
chunk1
-
-chunk2
-
-
-
-chunk3
-
-```````````````````````````````` - - -Any initial spaces beyond four will be included in the content, even -in interior blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 -. -
chunk1
-  
-  chunk2
-
-```````````````````````````````` - - -An indented code block cannot interrupt a paragraph. (This -allows hanging indents and the like.) - -```````````````````````````````` example -Foo - bar - -. -

Foo -bar

-```````````````````````````````` - - -However, any non-blank line with fewer than four leading spaces ends -the code block immediately. So a paragraph may occur immediately -after indented code: - -```````````````````````````````` example - foo -bar -. -
foo
-
-

bar

-```````````````````````````````` - - -And indented code can occur immediately before and after other kinds of -blocks: - -```````````````````````````````` example -# Heading - foo -Heading ------- - foo ----- -. -

Heading

-
foo
-
-

Heading

-
foo
-
-
-```````````````````````````````` - - -The first line can be indented more than four spaces: - -```````````````````````````````` example - foo - bar -. -
    foo
-bar
-
-```````````````````````````````` - - -Blank lines preceding or following an indented code block -are not included in it: - -```````````````````````````````` example - - - foo - - -. -
foo
-
-```````````````````````````````` - - -Trailing spaces are included in the code block's content: - -```````````````````````````````` example - foo -. -
foo  
-
-```````````````````````````````` - - - -## Fenced code blocks - -A [code fence](@) is a sequence -of at least three consecutive backtick characters (`` ` ``) or -tildes (`~`). (Tildes and backticks cannot be mixed.) -A [fenced code block](@) -begins with a code fence, indented no more than three spaces. - -The line with the opening code fence may optionally contain some text -following the code fence; this is trimmed of leading and trailing -whitespace and called the [info string](@). If the [info string] comes -after a backtick fence, it may not contain any backtick -characters. (The reason for this restriction is that otherwise -some inline code would be incorrectly interpreted as the -beginning of a fenced code block.) - -The content of the code block consists of all subsequent lines, until -a closing [code fence] of the same type as the code block -began with (backticks or tildes), and with at least as many backticks -or tildes as the opening code fence. If the leading code fence is -indented N spaces, then up to N spaces of indentation are removed from -each line of the content (if present). (If a content line is not -indented, it is preserved unchanged. If it is indented less than N -spaces, all of the indentation is removed.) - -The closing code fence may be indented up to three spaces, and may be -followed only by spaces, which are ignored. If the end of the -containing block (or document) is reached and no closing code fence -has been found, the code block contains all of the lines after the -opening code fence until the end of the containing block (or -document). (An alternative spec would require backtracking in the -event that a closing code fence is not found. But this makes parsing -much less efficient, and there seems to be no real down side to the -behavior described here.) - -A fenced code block may interrupt a paragraph, and does not require -a blank line either before or after. - -The content of a code fence is treated as literal text, not parsed -as inlines. The first word of the [info string] is typically used to -specify the language of the code sample, and rendered in the `class` -attribute of the `code` tag. However, this spec does not mandate any -particular treatment of the [info string]. - -Here is a simple example with backticks: - -```````````````````````````````` example -``` -< - > -``` -. -
<
- >
-
-```````````````````````````````` - - -With tildes: - -```````````````````````````````` example -~~~ -< - > -~~~ -. -
<
- >
-
-```````````````````````````````` - -Fewer than three backticks is not enough: - -```````````````````````````````` example -`` -foo -`` -. -

foo

-```````````````````````````````` - -The closing code fence must use the same character as the opening -fence: - -```````````````````````````````` example -``` -aaa -~~~ -``` -. -
aaa
-~~~
-
-```````````````````````````````` - - -```````````````````````````````` example -~~~ -aaa -``` -~~~ -. -
aaa
-```
-
-```````````````````````````````` - - -The closing code fence must be at least as long as the opening fence: - -```````````````````````````````` example -```` -aaa -``` -`````` -. -
aaa
-```
-
-```````````````````````````````` - - -```````````````````````````````` example -~~~~ -aaa -~~~ -~~~~ -. -
aaa
-~~~
-
-```````````````````````````````` - - -Unclosed code blocks are closed by the end of the document -(or the enclosing [block quote][block quotes] or [list item][list items]): - -```````````````````````````````` example -``` -. -
-```````````````````````````````` - - -```````````````````````````````` example -````` - -``` -aaa -. -

-```
-aaa
-
-```````````````````````````````` - - -```````````````````````````````` example -> ``` -> aaa - -bbb -. -
-
aaa
-
-
-

bbb

-```````````````````````````````` - - -A code block can have all empty lines as its content: - -```````````````````````````````` example -``` - - -``` -. -

-  
-
-```````````````````````````````` - - -A code block can be empty: - -```````````````````````````````` example -``` -``` -. -
-```````````````````````````````` - - -Fences can be indented. If the opening fence is indented, -content lines will have equivalent opening indentation removed, -if present: - -```````````````````````````````` example - ``` - aaa -aaa -``` -. -
aaa
-aaa
-
-```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - aaa -aaa - ``` -. -
aaa
-aaa
-aaa
-
-```````````````````````````````` - - -```````````````````````````````` example - ``` - aaa - aaa - aaa - ``` -. -
aaa
- aaa
-aaa
-
-```````````````````````````````` - - -Four spaces indentation produces an indented code block: - -```````````````````````````````` example - ``` - aaa - ``` -. -
```
-aaa
-```
-
-```````````````````````````````` - - -Closing fences may be indented by 0-3 spaces, and their indentation -need not match that of the opening fence: - -```````````````````````````````` example -``` -aaa - ``` -. -
aaa
-
-```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - ``` -. -
aaa
-
-```````````````````````````````` - - -This is not a closing fence, because it is indented 4 spaces: - -```````````````````````````````` example -``` -aaa - ``` -. -
aaa
-    ```
-
-```````````````````````````````` - - - -Code fences (opening and closing) cannot contain internal spaces: - -```````````````````````````````` example -``` ``` -aaa -. -

-aaa

-```````````````````````````````` - - -```````````````````````````````` example -~~~~~~ -aaa -~~~ ~~ -. -
aaa
-~~~ ~~
-
-```````````````````````````````` - - -Fenced code blocks can interrupt paragraphs, and can be followed -directly by paragraphs, without a blank line between: - -```````````````````````````````` example -foo -``` -bar -``` -baz -. -

foo

-
bar
-
-

baz

-```````````````````````````````` - - -Other blocks can also occur before and after fenced code blocks -without an intervening blank line: - -```````````````````````````````` example -foo ---- -~~~ -bar -~~~ -# baz -. -

foo

-
bar
-
-

baz

-```````````````````````````````` - - -An [info string] can be provided after the opening code fence. -Opening and closing spaces will be stripped, and the first word, prefixed -with `language-`, is used as the value for the `class` attribute of the -`code` element within the enclosing `pre` element. - -```````````````````````````````` example -```ruby -def foo(x) - return 3 -end -``` -. -
def foo(x)
-  return 3
-end
-
-```````````````````````````````` - - -```````````````````````````````` example -~~~~ ruby startline=3 $%@#$ -def foo(x) - return 3 -end -~~~~~~~ -. -
def foo(x)
-  return 3
-end
-
-```````````````````````````````` - - -```````````````````````````````` example -````; -```` -. -
-```````````````````````````````` - - -[Info strings] for backtick code blocks cannot contain backticks: - -```````````````````````````````` example -``` aa ``` -foo -. -

aa -foo

-```````````````````````````````` - - -[Info strings] for tilde code blocks can contain backticks and tildes: - -```````````````````````````````` example -~~~ aa ``` ~~~ -foo -~~~ -. -
foo
-
-```````````````````````````````` - - -Closing code fences cannot have [info strings]: - -```````````````````````````````` example -``` -``` aaa -``` -. -
``` aaa
-
-```````````````````````````````` - - - -## HTML blocks - -An [HTML block](@) is a group of lines that is treated -as raw HTML (and will not be escaped in HTML output). - -There are seven kinds of [HTML block], which can be defined -by their start and end conditions. The block begins with a line that -meets a [start condition](@) (after up to three spaces -optional indentation). It ends with the first subsequent line that -meets a matching [end condition](@), or the last line of -the document or other [container block](#container-blocks)), if no -line is encountered that meets the [end condition]. If the first line -meets both the [start condition] and the [end condition], the block -will contain just that line. - -1. **Start condition:** line begins with the string ``, or the end of the line.\ -**End condition:** line contains an end tag -``, ``, or `` (case-insensitive; it -need not match the start tag). - -2. **Start condition:** line begins with the string ``. - -3. **Start condition:** line begins with the string ``. - -4. **Start condition:** line begins with the string ``. - -5. **Start condition:** line begins with the string -``. - -6. **Start condition:** line begins the string `<` or ``, or -the string `/>`.\ -**End condition:** line is followed by a [blank line]. - -7. **Start condition:** line begins with a complete [open tag] -or [closing tag] (with any [tag name] other than `script`, -`style`, or `pre`) followed only by [whitespace] -or the end of the line.\ -**End condition:** line is followed by a [blank line]. - -HTML blocks continue until they are closed by their appropriate -[end condition], or the last line of the document or other [container -block](#container-blocks). This means any HTML **within an HTML -block** that might otherwise be recognised as a start condition will -be ignored by the parser and passed through as-is, without changing -the parser's state. - -For instance, `
` within a HTML block started by `` will not affect
-the parser state; as the HTML block was started in by start condition 6, it
-will end at any blank line. This can be surprising:
-
-```````````````````````````````` example
-
-
-**Hello**,
-
-_world_.
-
-
-. -
-
-**Hello**,
-

world. -

-
-```````````````````````````````` - -In this case, the HTML block is terminated by the newline — the `**Hello**` -text remains verbatim — and regular parsing resumes, with a paragraph, -emphasised `world` and inline and block HTML following. - -All types of [HTML blocks] except type 7 may interrupt -a paragraph. Blocks of type 7 may not interrupt a paragraph. -(This restriction is intended to prevent unwanted interpretation -of long tags inside a wrapped paragraph as starting HTML blocks.) - -Some simple examples follow. Here are some basic HTML blocks -of type 6: - -```````````````````````````````` example - - - - -
- hi -
- -okay. -. - - - - -
- hi -
-

okay.

-```````````````````````````````` - - -```````````````````````````````` example -
-*foo* -```````````````````````````````` - - -Here we have two HTML blocks with a Markdown paragraph between them: - -```````````````````````````````` example -
- -*Markdown* - -
-. -
-

Markdown

-
-```````````````````````````````` - - -The tag on the first line can be partial, as long -as it is split where there would be whitespace: - -```````````````````````````````` example -
-
-. -
-
-```````````````````````````````` - - -```````````````````````````````` example -
-
-. -
-
-```````````````````````````````` - - -An open tag need not be closed: -```````````````````````````````` example -
-*foo* - -*bar* -. -
-*foo* -

bar

-```````````````````````````````` - - - -A partial tag need not even be completed (garbage -in, garbage out): - -```````````````````````````````` example -
-. - -```````````````````````````````` - - -```````````````````````````````` example -
-foo -
-. -
-foo -
-```````````````````````````````` - - -Everything until the next blank line or end of document -gets included in the HTML block. So, in the following -example, what looks like a Markdown code block -is actually part of the HTML block, which continues until a blank -line or the end of the document is reached: - -```````````````````````````````` example -
-``` c -int x = 33; -``` -. -
-``` c -int x = 33; -``` -```````````````````````````````` - - -To start an [HTML block] with a tag that is *not* in the -list of block-level tags in (6), you must put the tag by -itself on the first line (and it must be complete): - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -In type 7 blocks, the [tag name] can be anything: - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -```````````````````````````````` example - -*bar* - -. - -*bar* - -```````````````````````````````` - - -```````````````````````````````` example - -*bar* -. - -*bar* -```````````````````````````````` - - -These rules are designed to allow us to work with tags that -can function as either block-level or inline-level tags. -The `` tag is a nice example. We can surround content with -`` tags in three different ways. In this case, we get a raw -HTML block, because the `` tag is on a line by itself: - -```````````````````````````````` example - -*foo* - -. - -*foo* - -```````````````````````````````` - - -In this case, we get a raw HTML block that just includes -the `` tag (because it ends with the following blank -line). So the contents get interpreted as CommonMark: - -```````````````````````````````` example - - -*foo* - - -. - -

foo

-
-```````````````````````````````` - - -Finally, in this case, the `` tags are interpreted -as [raw HTML] *inside* the CommonMark paragraph. (Because -the tag is not on a line by itself, we get inline HTML -rather than an [HTML block].) - -```````````````````````````````` example -*foo* -. -

foo

-```````````````````````````````` - - -HTML tags designed to contain literal content -(`script`, `style`, `pre`), comments, processing instructions, -and declarations are treated somewhat differently. -Instead of ending at the first blank line, these blocks -end at the first line containing a corresponding end tag. -As a result, these blocks can contain blank lines: - -A pre tag (type 1): - -```````````````````````````````` example -

-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-
-okay -. -

-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-
-

okay

-```````````````````````````````` - - -A script tag (type 1): - -```````````````````````````````` example - -okay -. - -

okay

-```````````````````````````````` - - -A style tag (type 1): - -```````````````````````````````` example - -okay -. - -

okay

-```````````````````````````````` - - -If there is no matching end tag, the block will end at the -end of the document (or the enclosing [block quote][block quotes] -or [list item][list items]): - -```````````````````````````````` example - -*foo* -. - -

foo

-```````````````````````````````` - - -```````````````````````````````` example -*bar* -*baz* -. -*bar* -

baz

-```````````````````````````````` - - -Note that anything on the last line after the -end tag will be included in the [HTML block]: - -```````````````````````````````` example -1. *bar* -. -1. *bar* -```````````````````````````````` - - -A comment (type 2): - -```````````````````````````````` example - -okay -. - -

okay

-```````````````````````````````` - - - -A processing instruction (type 3): - -```````````````````````````````` example -'; - -?> -okay -. -'; - -?> -

okay

-```````````````````````````````` - - -A declaration (type 4): - -```````````````````````````````` example - -. - -```````````````````````````````` - - -CDATA (type 5): - -```````````````````````````````` example - -okay -. - -

okay

-```````````````````````````````` - - -The opening tag can be indented 1-3 spaces, but not 4: - -```````````````````````````````` example - - - -. - -
<!-- foo -->
-
-```````````````````````````````` - - -```````````````````````````````` example -
- -
-. -
-
<div>
-
-```````````````````````````````` - - -An HTML block of types 1--6 can interrupt a paragraph, and need not be -preceded by a blank line. - -```````````````````````````````` example -Foo -
-bar -
-. -

Foo

-
-bar -
-```````````````````````````````` - - -However, a following blank line is needed, except at the end of -a document, and except for blocks of types 1--5, [above][HTML -block]: - -```````````````````````````````` example -
-bar -
-*foo* -. -
-bar -
-*foo* -```````````````````````````````` - - -HTML blocks of type 7 cannot interrupt a paragraph: - -```````````````````````````````` example -Foo - -baz -. -

Foo - -baz

-```````````````````````````````` - - -This rule differs from John Gruber's original Markdown syntax -specification, which says: - -> The only restrictions are that block-level HTML elements — -> e.g. `
`, ``, `
`, `

`, etc. — must be separated from -> surrounding content by blank lines, and the start and end tags of the -> block should not be indented with tabs or spaces. - -In some ways Gruber's rule is more restrictive than the one given -here: - -- It requires that an HTML block be preceded by a blank line. -- It does not allow the start tag to be indented. -- It requires a matching end tag, which it also does not allow to - be indented. - -Most Markdown implementations (including some of Gruber's own) do not -respect all of these restrictions. - -There is one respect, however, in which Gruber's rule is more liberal -than the one given here, since it allows blank lines to occur inside -an HTML block. There are two reasons for disallowing them here. -First, it removes the need to parse balanced tags, which is -expensive and can require backtracking from the end of the document -if no matching end tag is found. Second, it provides a very simple -and flexible way of including Markdown content inside HTML tags: -simply separate the Markdown from the HTML using blank lines: - -Compare: - -```````````````````````````````` example -

- -*Emphasized* text. - -
-. -
-

Emphasized text.

-
-```````````````````````````````` - - -```````````````````````````````` example -
-*Emphasized* text. -
-. -
-*Emphasized* text. -
-```````````````````````````````` - - -Some Markdown implementations have adopted a convention of -interpreting content inside tags as text if the open tag has -the attribute `markdown=1`. The rule given above seems a simpler and -more elegant way of achieving the same expressive power, which is also -much simpler to parse. - -The main potential drawback is that one can no longer paste HTML -blocks into Markdown documents with 100% reliability. However, -*in most cases* this will work fine, because the blank lines in -HTML are usually followed by HTML block tags. For example: - -```````````````````````````````` example -
- - - - - - - -
-Hi -
-. - - - - -
-Hi -
-```````````````````````````````` - - -There are problems, however, if the inner tags are indented -*and* separated by spaces, as then they will be interpreted as -an indented code block: - -```````````````````````````````` example - - - - - - - - -
- Hi -
-. - - -
<td>
-  Hi
-</td>
-
- -
-```````````````````````````````` - - -Fortunately, blank lines are usually not necessary and can be -deleted. The exception is inside `
` tags, but as described
-[above][HTML blocks], raw HTML blocks starting with `
`
-*can* contain blank lines.
-
-## Link reference definitions
-
-A [link reference definition](@)
-consists of a [link label], indented up to three spaces, followed
-by a colon (`:`), optional [whitespace] (including up to one
-[line ending]), a [link destination],
-optional [whitespace] (including up to one
-[line ending]), and an optional [link
-title], which if it is present must be separated
-from the [link destination] by [whitespace].
-No further [non-whitespace characters] may occur on the line.
-
-A [link reference definition]
-does not correspond to a structural element of a document.  Instead, it
-defines a label which can be used in [reference links]
-and reference-style [images] elsewhere in the document.  [Link
-reference definitions] can come either before or after the links that use
-them.
-
-```````````````````````````````` example
-[foo]: /url "title"
-
-[foo]
-.
-

foo

-```````````````````````````````` - - -```````````````````````````````` example - [foo]: - /url - 'the title' - -[foo] -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -[Foo*bar\]]:my_(url) 'title (with parens)' - -[Foo*bar\]] -. -

Foo*bar]

-```````````````````````````````` - - -```````````````````````````````` example -[Foo bar]: - -'title' - -[Foo bar] -. -

Foo bar

-```````````````````````````````` - - -The title may extend over multiple lines: - -```````````````````````````````` example -[foo]: /url ' -title -line1 -line2 -' - -[foo] -. -

foo

-```````````````````````````````` - - -However, it may not contain a [blank line]: - -```````````````````````````````` example -[foo]: /url 'title - -with blank line' - -[foo] -. -

[foo]: /url 'title

-

with blank line'

-

[foo]

-```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[foo]: -/url - -[foo] -. -

foo

-```````````````````````````````` - - -The link destination may not be omitted: - -```````````````````````````````` example -[foo]: - -[foo] -. -

[foo]:

-

[foo]

-```````````````````````````````` - -The title must be separated from the link destination by -whitespace: - -```````````````````````````````` example -[foo]: (baz) - -[foo] -. -

[foo]: (baz)

-

[foo]

-```````````````````````````````` - - -Both title and destination can contain backslash escapes -and literal backslashes: - -```````````````````````````````` example -[foo]: /url\bar\*baz "foo\"bar\baz" - -[foo] -. -

foo

-```````````````````````````````` - - -A link can come before its corresponding definition: - -```````````````````````````````` example -[foo] - -[foo]: url -. -

foo

-```````````````````````````````` - - -If there are several matching definitions, the first one takes -precedence: - -```````````````````````````````` example -[foo] - -[foo]: first -[foo]: second -. -

foo

-```````````````````````````````` - - -As noted in the section on [Links], matching of labels is -case-insensitive (see [matches]). - -```````````````````````````````` example -[FOO]: /url - -[Foo] -. -

Foo

-```````````````````````````````` - - -```````````````````````````````` example -[ΑΓΩ]: /φου - -[αγω] -. -

αγω

-```````````````````````````````` - - -Here is a link reference definition with no corresponding link. -It contributes nothing to the document. - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -Here is another one: - -```````````````````````````````` example -[ -foo -]: /url -bar -. -

bar

-```````````````````````````````` - - -This is not a link reference definition, because there are -[non-whitespace characters] after the title: - -```````````````````````````````` example -[foo]: /url "title" ok -. -

[foo]: /url "title" ok

-```````````````````````````````` - - -This is a link reference definition, but it has no title: - -```````````````````````````````` example -[foo]: /url -"title" ok -. -

"title" ok

-```````````````````````````````` - - -This is not a link reference definition, because it is indented -four spaces: - -```````````````````````````````` example - [foo]: /url "title" - -[foo] -. -
[foo]: /url "title"
-
-

[foo]

-```````````````````````````````` - - -This is not a link reference definition, because it occurs inside -a code block: - -```````````````````````````````` example -``` -[foo]: /url -``` - -[foo] -. -
[foo]: /url
-
-

[foo]

-```````````````````````````````` - - -A [link reference definition] cannot interrupt a paragraph. - -```````````````````````````````` example -Foo -[bar]: /baz - -[bar] -. -

Foo -[bar]: /baz

-

[bar]

-```````````````````````````````` - - -However, it can directly follow other block elements, such as headings -and thematic breaks, and it need not be followed by a blank line. - -```````````````````````````````` example -# [Foo] -[foo]: /url -> bar -. -

Foo

-
-

bar

-
-```````````````````````````````` - - -Several [link reference definitions] -can occur one after another, without intervening blank lines. - -```````````````````````````````` example -[foo]: /foo-url "foo" -[bar]: /bar-url - "bar" -[baz]: /baz-url - -[foo], -[bar], -[baz] -. -

foo, -bar, -baz

-```````````````````````````````` - - -[Link reference definitions] can occur -inside block containers, like lists and block quotations. They -affect the entire document, not just the container in which they -are defined: - -```````````````````````````````` example -[foo] - -> [foo]: /url -. -

foo

-
-
-```````````````````````````````` - - - -## Paragraphs - -A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a [paragraph](@). -The contents of the paragraph are the result of parsing the -paragraph's raw content as inlines. The paragraph's raw content -is formed by concatenating the lines and removing initial and final -[whitespace]. - -A simple example with two paragraphs: - -```````````````````````````````` example -aaa - -bbb -. -

aaa

-

bbb

-```````````````````````````````` - - -Paragraphs can contain multiple lines, but no blank lines: - -```````````````````````````````` example -aaa -bbb - -ccc -ddd -. -

aaa -bbb

-

ccc -ddd

-```````````````````````````````` - - -Multiple blank lines between paragraph have no effect: - -```````````````````````````````` example -aaa - - -bbb -. -

aaa

-

bbb

-```````````````````````````````` - - -Leading spaces are skipped: - -```````````````````````````````` example - aaa - bbb -. -

aaa -bbb

-```````````````````````````````` - - -Lines after the first may be indented any amount, since indented -code blocks cannot interrupt paragraphs. - -```````````````````````````````` example -aaa - bbb - ccc -. -

aaa -bbb -ccc

-```````````````````````````````` - - -However, the first line may be indented at most three spaces, -or an indented code block will be triggered: - -```````````````````````````````` example - aaa -bbb -. -

aaa -bbb

-```````````````````````````````` - - -```````````````````````````````` example - aaa -bbb -. -
aaa
-
-

bbb

-```````````````````````````````` - - -Final spaces are stripped before inline parsing, so a paragraph -that ends with two or more spaces will not end with a [hard line -break]: - -```````````````````````````````` example -aaa -bbb -. -

aaa
-bbb

-```````````````````````````````` - - -## Blank lines - -[Blank lines] between block-level elements are ignored, -except for the role they play in determining whether a [list] -is [tight] or [loose]. - -Blank lines at the beginning and end of the document are also ignored. - -```````````````````````````````` example - - -aaa - - -# aaa - - -. -

aaa

-

aaa

-```````````````````````````````` - - - -# Container blocks - -A [container block](#container-blocks) is a block that has other -blocks as its contents. There are two basic kinds of container blocks: -[block quotes] and [list items]. -[Lists] are meta-containers for [list items]. - -We define the syntax for container blocks recursively. The general -form of the definition is: - -> If X is a sequence of blocks, then the result of -> transforming X in such-and-such a way is a container of type Y -> with these blocks as its content. - -So, we explain what counts as a block quote or list item by explaining -how these can be *generated* from their contents. This should suffice -to define the syntax, although it does not give a recipe for *parsing* -these constructions. (A recipe is provided below in the section entitled -[A parsing strategy](#appendix-a-parsing-strategy).) - -## Block quotes - -A [block quote marker](@) -consists of 0-3 spaces of initial indent, plus (a) the character `>` together -with a following space, or (b) a single character `>` not followed by a space. - -The following rules define [block quotes]: - -1. **Basic case.** If a string of lines *Ls* constitute a sequence - of blocks *Bs*, then the result of prepending a [block quote - marker] to the beginning of each line in *Ls* - is a [block quote](#block-quotes) containing *Bs*. - -2. **Laziness.** If a string of lines *Ls* constitute a [block - quote](#block-quotes) with contents *Bs*, then the result of deleting - the initial [block quote marker] from one or - more lines in which the next [non-whitespace character] after the [block - quote marker] is [paragraph continuation - text] is a block quote with *Bs* as its content. - [Paragraph continuation text](@) is text - that will be parsed as part of the content of a paragraph, but does - not occur at the beginning of the paragraph. - -3. **Consecutiveness.** A document cannot contain two [block - quotes] in a row unless there is a [blank line] between them. - -Nothing else counts as a [block quote](#block-quotes). - -Here is a simple example: - -```````````````````````````````` example -> # Foo -> bar -> baz -. -
-

Foo

-

bar -baz

-
-```````````````````````````````` - - -The spaces after the `>` characters can be omitted: - -```````````````````````````````` example -># Foo ->bar -> baz -. -
-

Foo

-

bar -baz

-
-```````````````````````````````` - - -The `>` characters can be indented 1-3 spaces: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -
-

Foo

-

bar -baz

-
-```````````````````````````````` - - -Four spaces gives us a code block: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -
> # Foo
-> bar
-> baz
-
-```````````````````````````````` - - -The Laziness clause allows us to omit the `>` before -[paragraph continuation text]: - -```````````````````````````````` example -> # Foo -> bar -baz -. -
-

Foo

-

bar -baz

-
-```````````````````````````````` - - -A block quote can contain some lazy and some non-lazy -continuation lines: - -```````````````````````````````` example -> bar -baz -> foo -. -
-

bar -baz -foo

-
-```````````````````````````````` - - -Laziness only applies to lines that would have been continuations of -paragraphs had they been prepended with [block quote markers]. -For example, the `> ` cannot be omitted in the second line of - -``` markdown -> foo -> --- -``` - -without changing the meaning: - -```````````````````````````````` example -> foo ---- -. -
-

foo

-
-
-```````````````````````````````` - - -Similarly, if we omit the `> ` in the second line of - -``` markdown -> - foo -> - bar -``` - -then the block quote ends after the first line: - -```````````````````````````````` example -> - foo -- bar -. -
-
    -
  • foo
  • -
-
-
    -
  • bar
  • -
-```````````````````````````````` - - -For the same reason, we can't omit the `> ` in front of -subsequent lines of an indented or fenced code block: - -```````````````````````````````` example -> foo - bar -. -
-
foo
-
-
-
bar
-
-```````````````````````````````` - - -```````````````````````````````` example -> ``` -foo -``` -. -
-
-
-

foo

-
-```````````````````````````````` - - -Note that in the following case, we have a [lazy -continuation line]: - -```````````````````````````````` example -> foo - - bar -. -
-

foo -- bar

-
-```````````````````````````````` - - -To see why, note that in - -```markdown -> foo -> - bar -``` - -the `- bar` is indented too far to start a list, and can't -be an indented code block because indented code blocks cannot -interrupt paragraphs, so it is [paragraph continuation text]. - -A block quote can be empty: - -```````````````````````````````` example -> -. -
-
-```````````````````````````````` - - -```````````````````````````````` example -> -> -> -. -
-
-```````````````````````````````` - - -A block quote can have initial or final blank lines: - -```````````````````````````````` example -> -> foo -> -. -
-

foo

-
-```````````````````````````````` - - -A blank line always separates block quotes: - -```````````````````````````````` example -> foo - -> bar -. -
-

foo

-
-
-

bar

-
-```````````````````````````````` - - -(Most current Markdown implementations, including John Gruber's -original `Markdown.pl`, will parse this example as a single block quote -with two paragraphs. But it seems better to allow the author to decide -whether two block quotes or one are wanted.) - -Consecutiveness means that if we put these block quotes together, -we get a single block quote: - -```````````````````````````````` example -> foo -> bar -. -
-

foo -bar

-
-```````````````````````````````` - - -To get a block quote with two paragraphs, use: - -```````````````````````````````` example -> foo -> -> bar -. -
-

foo

-

bar

-
-```````````````````````````````` - - -Block quotes can interrupt paragraphs: - -```````````````````````````````` example -foo -> bar -. -

foo

-
-

bar

-
-```````````````````````````````` - - -In general, blank lines are not needed before or after block -quotes: - -```````````````````````````````` example -> aaa -*** -> bbb -. -
-

aaa

-
-
-
-

bbb

-
-```````````````````````````````` - - -However, because of laziness, a blank line is needed between -a block quote and a following paragraph: - -```````````````````````````````` example -> bar -baz -. -
-

bar -baz

-
-```````````````````````````````` - - -```````````````````````````````` example -> bar - -baz -. -
-

bar

-
-

baz

-```````````````````````````````` - - -```````````````````````````````` example -> bar -> -baz -. -
-

bar

-
-

baz

-```````````````````````````````` - - -It is a consequence of the Laziness rule that any number -of initial `>`s may be omitted on a continuation line of a -nested block quote: - -```````````````````````````````` example -> > > foo -bar -. -
-
-
-

foo -bar

-
-
-
-```````````````````````````````` - - -```````````````````````````````` example ->>> foo -> bar ->>baz -. -
-
-
-

foo -bar -baz

-
-
-
-```````````````````````````````` - - -When including an indented code block in a block quote, -remember that the [block quote marker] includes -both the `>` and a following space. So *five spaces* are needed after -the `>`: - -```````````````````````````````` example -> code - -> not code -. -
-
code
-
-
-
-

not code

-
-```````````````````````````````` - - - -## List items - -A [list marker](@) is a -[bullet list marker] or an [ordered list marker]. - -A [bullet list marker](@) -is a `-`, `+`, or `*` character. - -An [ordered list marker](@) -is a sequence of 1--9 arabic digits (`0-9`), followed by either a -`.` character or a `)` character. (The reason for the length -limit is that with 10 digits we start seeing integer overflows -in some browsers.) - -The following rules define [list items]: - -1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of - blocks *Bs* starting with a [non-whitespace character] and not separated - from each other by more than one blank line, and *M* is a list - marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces, then the result - of prepending *M* and the following spaces to the first line of - *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a - list item with *Bs* as its contents. The type of the list item - (bullet or ordered) is determined by the type of its list marker. - If the list item is ordered, then it is also assigned a start - number, based on the ordered list marker. - - Exceptions: - - 1. When the first list item in a [list] interrupts - a paragraph---that is, when it starts on a line that would - otherwise count as [paragraph continuation text]---then (a) - the lines *Ls* must not begin with a blank line, and (b) if - the list item is ordered, the start number must be 1. - 2. If any line is a [thematic break][thematic breaks] then - that line is not a list item. - -For example, let *Ls* be the lines - -```````````````````````````````` example -A paragraph -with two lines. - - indented code - -> A block quote. -. -

A paragraph -with two lines.

-
indented code
-
-
-

A block quote.

-
-```````````````````````````````` - - -And let *M* be the marker `1.`, and *N* = 2. Then rule #1 says -that the following is an ordered list item with start number 1, -and the same contents as *Ls*: - -```````````````````````````````` example -1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-```````````````````````````````` - - -The most important thing to notice is that the position of -the text after the list marker determines how much indentation -is needed in subsequent blocks in the list item. If the list -marker takes up two spaces, and there are three spaces between -the list marker and the next [non-whitespace character], then blocks -must be indented five spaces in order to fall under the list -item. - -Here are some examples showing how far content must be indented to be -put under the list item: - -```````````````````````````````` example -- one - - two -. -
    -
  • one
  • -
-

two

-```````````````````````````````` - - -```````````````````````````````` example -- one - - two -. -
    -
  • -

    one

    -

    two

    -
  • -
-```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -
    -
  • one
  • -
-
 two
-
-```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -
    -
  • -

    one

    -

    two

    -
  • -
-```````````````````````````````` - - -It is tempting to think of this in terms of columns: the continuation -blocks must be indented at least to the column of the first -[non-whitespace character] after the list marker. However, that is not quite right. -The spaces after the list marker determine how much relative indentation -is needed. Which column this indentation reaches will depend on -how the list item is embedded in other constructions, as shown by -this example: - -```````````````````````````````` example - > > 1. one ->> ->> two -. -
-
-
    -
  1. -

    one

    -

    two

    -
  2. -
-
-
-```````````````````````````````` - - -Here `two` occurs in the same column as the list marker `1.`, -but is actually contained in the list item, because there is -sufficient indentation after the last containing blockquote marker. - -The converse is also possible. In the following example, the word `two` -occurs far to the right of the initial text of the list item, `one`, but -it is not considered part of the list item, because it is not indented -far enough past the blockquote marker: - -```````````````````````````````` example ->>- one ->> - > > two -. -
-
-
    -
  • one
  • -
-

two

-
-
-```````````````````````````````` - - -Note that at least one space is needed between the list marker and -any following content, so these are not list items: - -```````````````````````````````` example --one - -2.two -. -

-one

-

2.two

-```````````````````````````````` - - -A list item may contain blocks that are separated by more than -one blank line. - -```````````````````````````````` example -- foo - - - bar -. -
    -
  • -

    foo

    -

    bar

    -
  • -
-```````````````````````````````` - - -A list item may contain any kind of block: - -```````````````````````````````` example -1. foo - - ``` - bar - ``` - - baz - - > bam -. -
    -
  1. -

    foo

    -
    bar
    -
    -

    baz

    -
    -

    bam

    -
    -
  2. -
-```````````````````````````````` - - -A list item that contains an indented code block will preserve -empty lines within the code block verbatim. - -```````````````````````````````` example -- Foo - - bar - - - baz -. -
    -
  • -

    Foo

    -
    bar
    -
    -
    -baz
    -
    -
  • -
-```````````````````````````````` - -Note that ordered list start numbers must be nine digits or less: - -```````````````````````````````` example -123456789. ok -. -
    -
  1. ok
  2. -
-```````````````````````````````` - - -```````````````````````````````` example -1234567890. not ok -. -

1234567890. not ok

-```````````````````````````````` - - -A start number may begin with 0s: - -```````````````````````````````` example -0. ok -. -
    -
  1. ok
  2. -
-```````````````````````````````` - - -```````````````````````````````` example -003. ok -. -
    -
  1. ok
  2. -
-```````````````````````````````` - - -A start number may not be negative: - -```````````````````````````````` example --1. not ok -. -

-1. not ok

-```````````````````````````````` - - - -2. **Item starting with indented code.** If a sequence of lines *Ls* - constitute a sequence of blocks *Bs* starting with an indented code - block and not separated from each other by more than one blank line, - and *M* is a list marker of width *W* followed by - one space, then the result of prepending *M* and the following - space to the first line of *Ls*, and indenting subsequent lines of - *Ls* by *W + 1* spaces, is a list item with *Bs* as its contents. - If a line is empty, then it need not be indented. The type of the - list item (bullet or ordered) is determined by the type of its list - marker. If the list item is ordered, then it is also assigned a - start number, based on the ordered list marker. - -An indented code block will have to be indented four spaces beyond -the edge of the region where text will be included in the list item. -In the following case that is 6 spaces: - -```````````````````````````````` example -- foo - - bar -. -
    -
  • -

    foo

    -
    bar
    -
    -
  • -
-```````````````````````````````` - - -And in this case it is 11 spaces: - -```````````````````````````````` example - 10. foo - - bar -. -
    -
  1. -

    foo

    -
    bar
    -
    -
  2. -
-```````````````````````````````` - - -If the *first* block in the list item is an indented code block, -then by rule #2, the contents must be indented *one* space after the -list marker: - -```````````````````````````````` example - indented code - -paragraph - - more code -. -
indented code
-
-

paragraph

-
more code
-
-```````````````````````````````` - - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -
    -
  1. -
    indented code
    -
    -

    paragraph

    -
    more code
    -
    -
  2. -
-```````````````````````````````` - - -Note that an additional space indent is interpreted as space -inside the code block: - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -
    -
  1. -
     indented code
    -
    -

    paragraph

    -
    more code
    -
    -
  2. -
-```````````````````````````````` - - -Note that rules #1 and #2 only apply to two cases: (a) cases -in which the lines to be included in a list item begin with a -[non-whitespace character], and (b) cases in which -they begin with an indented code -block. In a case like the following, where the first block begins with -a three-space indent, the rules do not allow us to form a list item by -indenting the whole thing and prepending a list marker: - -```````````````````````````````` example - foo - -bar -. -

foo

-

bar

-```````````````````````````````` - - -```````````````````````````````` example -- foo - - bar -. -
    -
  • foo
  • -
-

bar

-```````````````````````````````` - - -This is not a significant restriction, because when a block begins -with 1-3 spaces indent, the indentation can always be removed without -a change in interpretation, allowing rule #1 to be applied. So, in -the above case: - -```````````````````````````````` example -- foo - - bar -. -
    -
  • -

    foo

    -

    bar

    -
  • -
-```````````````````````````````` - - -3. **Item starting with a blank line.** If a sequence of lines *Ls* - starting with a single [blank line] constitute a (possibly empty) - sequence of blocks *Bs*, not separated from each other by more than - one blank line, and *M* is a list marker of width *W*, - then the result of prepending *M* to the first line of *Ls*, and - indenting subsequent lines of *Ls* by *W + 1* spaces, is a list - item with *Bs* as its contents. - If a line is empty, then it need not be indented. The type of the - list item (bullet or ordered) is determined by the type of its list - marker. If the list item is ordered, then it is also assigned a - start number, based on the ordered list marker. - -Here are some list items that start with a blank line but are not empty: - -```````````````````````````````` example -- - foo -- - ``` - bar - ``` -- - baz -. -
    -
  • foo
  • -
  • -
    bar
    -
    -
  • -
  • -
    baz
    -
    -
  • -
-```````````````````````````````` - -When the list item starts with a blank line, the number of spaces -following the list marker doesn't change the required indentation: - -```````````````````````````````` example -- - foo -. -
    -
  • foo
  • -
-```````````````````````````````` - - -A list item can begin with at most one blank line. -In the following example, `foo` is not part of the list -item: - -```````````````````````````````` example -- - - foo -. -
    -
  • -
-

foo

-```````````````````````````````` - - -Here is an empty bullet list item: - -```````````````````````````````` example -- foo -- -- bar -. -
    -
  • foo
  • -
  • -
  • bar
  • -
-```````````````````````````````` - - -It does not matter whether there are spaces following the [list marker]: - -```````````````````````````````` example -- foo -- -- bar -. -
    -
  • foo
  • -
  • -
  • bar
  • -
-```````````````````````````````` - - -Here is an empty ordered list item: - -```````````````````````````````` example -1. foo -2. -3. bar -. -
    -
  1. foo
  2. -
  3. -
  4. bar
  5. -
-```````````````````````````````` - - -A list may start or end with an empty list item: - -```````````````````````````````` example -* -. -
    -
  • -
-```````````````````````````````` - -However, an empty list item cannot interrupt a paragraph: - -```````````````````````````````` example -foo -* - -foo -1. -. -

foo -*

-

foo -1.

-```````````````````````````````` - - -4. **Indentation.** If a sequence of lines *Ls* constitutes a list item - according to rule #1, #2, or #3, then the result of indenting each line - of *Ls* by 1-3 spaces (the same for each line) also constitutes a - list item with the same contents and attributes. If a line is - empty, then it need not be indented. - -Indented one space: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-```````````````````````````````` - - -Indented two spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-```````````````````````````````` - - -Indented three spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-```````````````````````````````` - - -Four spaces indent gives a code block: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -
1.  A paragraph
-    with two lines.
-
-        indented code
-
-    > A block quote.
-
-```````````````````````````````` - - - -5. **Laziness.** If a string of lines *Ls* constitute a [list - item](#list-items) with contents *Bs*, then the result of deleting - some or all of the indentation from one or more lines in which the - next [non-whitespace character] after the indentation is - [paragraph continuation text] is a - list item with the same contents and attributes. The unindented - lines are called - [lazy continuation line](@)s. - -Here is an example with [lazy continuation lines]: - -```````````````````````````````` example - 1. A paragraph -with two lines. - - indented code - - > A block quote. -. -
    -
  1. -

    A paragraph -with two lines.

    -
    indented code
    -
    -
    -

    A block quote.

    -
    -
  2. -
-```````````````````````````````` - - -Indentation can be partially deleted: - -```````````````````````````````` example - 1. A paragraph - with two lines. -. -
    -
  1. A paragraph -with two lines.
  2. -
-```````````````````````````````` - - -These examples show how laziness can work in nested structures: - -```````````````````````````````` example -> 1. > Blockquote -continued here. -. -
-
    -
  1. -
    -

    Blockquote -continued here.

    -
    -
  2. -
-
-```````````````````````````````` - - -```````````````````````````````` example -> 1. > Blockquote -> continued here. -. -
-
    -
  1. -
    -

    Blockquote -continued here.

    -
    -
  2. -
-
-```````````````````````````````` - - - -6. **That's all.** Nothing that is not counted as a list item by rules - #1--5 counts as a [list item](#list-items). - -The rules for sublists follow from the general rules -[above][List items]. A sublist must be indented the same number -of spaces a paragraph would need to be in order to be included -in the list item. - -So, in this case we need two spaces indent: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -
    -
  • foo -
      -
    • bar -
        -
      • baz -
          -
        • boo
        • -
        -
      • -
      -
    • -
    -
  • -
-```````````````````````````````` - - -One is not enough: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -
    -
  • foo
  • -
  • bar
  • -
  • baz
  • -
  • boo
  • -
-```````````````````````````````` - - -Here we need four, because the list marker is wider: - -```````````````````````````````` example -10) foo - - bar -. -
    -
  1. foo -
      -
    • bar
    • -
    -
  2. -
-```````````````````````````````` - - -Three is not enough: - -```````````````````````````````` example -10) foo - - bar -. -
    -
  1. foo
  2. -
-
    -
  • bar
  • -
-```````````````````````````````` - - -A list may be the first block in a list item: - -```````````````````````````````` example -- - foo -. -
    -
  • -
      -
    • foo
    • -
    -
  • -
-```````````````````````````````` - - -```````````````````````````````` example -1. - 2. foo -. -
    -
  1. -
      -
    • -
        -
      1. foo
      2. -
      -
    • -
    -
  2. -
-```````````````````````````````` - - -A list item can contain a heading: - -```````````````````````````````` example -- # Foo -- Bar - --- - baz -. -
    -
  • -

    Foo

    -
  • -
  • -

    Bar

    -baz
  • -
-```````````````````````````````` - - -### Motivation - -John Gruber's Markdown spec says the following about list items: - -1. "List markers typically start at the left margin, but may be indented - by up to three spaces. List markers must be followed by one or more - spaces or a tab." - -2. "To make lists look nice, you can wrap items with hanging indents.... - But if you don't want to, you don't have to." - -3. "List items may consist of multiple paragraphs. Each subsequent - paragraph in a list item must be indented by either 4 spaces or one - tab." - -4. "It looks nice if you indent every line of the subsequent paragraphs, - but here again, Markdown will allow you to be lazy." - -5. "To put a blockquote within a list item, the blockquote's `>` - delimiters need to be indented." - -6. "To put a code block within a list item, the code block needs to be - indented twice — 8 spaces or two tabs." - -These rules specify that a paragraph under a list item must be indented -four spaces (presumably, from the left margin, rather than the start of -the list marker, but this is not said), and that code under a list item -must be indented eight spaces instead of the usual four. They also say -that a block quote must be indented, but not by how much; however, the -example given has four spaces indentation. Although nothing is said -about other kinds of block-level content, it is certainly reasonable to -infer that *all* block elements under a list item, including other -lists, must be indented four spaces. This principle has been called the -*four-space rule*. - -The four-space rule is clear and principled, and if the reference -implementation `Markdown.pl` had followed it, it probably would have -become the standard. However, `Markdown.pl` allowed paragraphs and -sublists to start with only two spaces indentation, at least on the -outer level. Worse, its behavior was inconsistent: a sublist of an -outer-level list needed two spaces indentation, but a sublist of this -sublist needed three spaces. It is not surprising, then, that different -implementations of Markdown have developed very different rules for -determining what comes under a list item. (Pandoc and python-Markdown, -for example, stuck with Gruber's syntax description and the four-space -rule, while discount, redcarpet, marked, PHP Markdown, and others -followed `Markdown.pl`'s behavior more closely.) - -Unfortunately, given the divergences between implementations, there -is no way to give a spec for list items that will be guaranteed not -to break any existing documents. However, the spec given here should -correctly handle lists formatted with either the four-space rule or -the more forgiving `Markdown.pl` behavior, provided they are laid out -in a way that is natural for a human to read. - -The strategy here is to let the width and indentation of the list marker -determine the indentation necessary for blocks to fall under the list -item, rather than having a fixed and arbitrary number. The writer can -think of the body of the list item as a unit which gets indented to the -right enough to fit the list marker (and any indentation on the list -marker). (The laziness rule, #5, then allows continuation lines to be -unindented if needed.) - -This rule is superior, we claim, to any rule requiring a fixed level of -indentation from the margin. The four-space rule is clear but -unnatural. It is quite unintuitive that - -``` markdown -- foo - - bar - - - baz -``` - -should be parsed as two lists with an intervening paragraph, - -``` html -
    -
  • foo
  • -
-

bar

-
    -
  • baz
  • -
-``` - -as the four-space rule demands, rather than a single list, - -``` html -
    -
  • -

    foo

    -

    bar

    -
      -
    • baz
    • -
    -
  • -
-``` - -The choice of four spaces is arbitrary. It can be learned, but it is -not likely to be guessed, and it trips up beginners regularly. - -Would it help to adopt a two-space rule? The problem is that such -a rule, together with the rule allowing 1--3 spaces indentation of the -initial list marker, allows text that is indented *less than* the -original list marker to be included in the list item. For example, -`Markdown.pl` parses - -``` markdown - - one - - two -``` - -as a single list item, with `two` a continuation paragraph: - -``` html -
    -
  • -

    one

    -

    two

    -
  • -
-``` - -and similarly - -``` markdown -> - one -> -> two -``` - -as - -``` html -
-
    -
  • -

    one

    -

    two

    -
  • -
-
-``` - -This is extremely unintuitive. - -Rather than requiring a fixed indent from the margin, we could require -a fixed indent (say, two spaces, or even one space) from the list marker (which -may itself be indented). This proposal would remove the last anomaly -discussed. Unlike the spec presented above, it would count the following -as a list item with a subparagraph, even though the paragraph `bar` -is not indented as far as the first paragraph `foo`: - -``` markdown - 10. foo - - bar -``` - -Arguably this text does read like a list item with `bar` as a subparagraph, -which may count in favor of the proposal. However, on this proposal indented -code would have to be indented six spaces after the list marker. And this -would break a lot of existing Markdown, which has the pattern: - -``` markdown -1. foo - - indented code -``` - -where the code is indented eight spaces. The spec above, by contrast, will -parse this text as expected, since the code block's indentation is measured -from the beginning of `foo`. - -The one case that needs special treatment is a list item that *starts* -with indented code. How much indentation is required in that case, since -we don't have a "first paragraph" to measure from? Rule #2 simply stipulates -that in such cases, we require one space indentation from the list marker -(and then the normal four spaces for the indented code). This will match the -four-space rule in cases where the list marker plus its initial indentation -takes four spaces (a common case), but diverge in other cases. - -## Lists - -A [list](@) is a sequence of one or more -list items [of the same type]. The list items -may be separated by any number of blank lines. - -Two list items are [of the same type](@) -if they begin with a [list marker] of the same type. -Two list markers are of the -same type if (a) they are bullet list markers using the same character -(`-`, `+`, or `*`) or (b) they are ordered list numbers with the same -delimiter (either `.` or `)`). - -A list is an [ordered list](@) -if its constituent list items begin with -[ordered list markers], and a -[bullet list](@) if its constituent list -items begin with [bullet list markers]. - -The [start number](@) -of an [ordered list] is determined by the list number of -its initial list item. The numbers of subsequent list items are -disregarded. - -A list is [loose](@) if any of its constituent -list items are separated by blank lines, or if any of its constituent -list items directly contain two block-level elements with a blank line -between them. Otherwise a list is [tight](@). -(The difference in HTML output is that paragraphs in a loose list are -wrapped in `

` tags, while paragraphs in a tight list are not.) - -Changing the bullet or ordered list delimiter starts a new list: - -```````````````````````````````` example -- foo -- bar -+ baz -. -

    -
  • foo
  • -
  • bar
  • -
-
    -
  • baz
  • -
-```````````````````````````````` - - -```````````````````````````````` example -1. foo -2. bar -3) baz -. -
    -
  1. foo
  2. -
  3. bar
  4. -
-
    -
  1. baz
  2. -
-```````````````````````````````` - - -In CommonMark, a list can interrupt a paragraph. That is, -no blank line is needed to separate a paragraph from a following -list: - -```````````````````````````````` example -Foo -- bar -- baz -. -

Foo

-
    -
  • bar
  • -
  • baz
  • -
-```````````````````````````````` - -`Markdown.pl` does not allow this, through fear of triggering a list -via a numeral in a hard-wrapped line: - -``` markdown -The number of windows in my house is -14. The number of doors is 6. -``` - -Oddly, though, `Markdown.pl` *does* allow a blockquote to -interrupt a paragraph, even though the same considerations might -apply. - -In CommonMark, we do allow lists to interrupt paragraphs, for -two reasons. First, it is natural and not uncommon for people -to start lists without blank lines: - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -Second, we are attracted to a - -> [principle of uniformity](@): -> if a chunk of text has a certain -> meaning, it will continue to have the same meaning when put into a -> container block (such as a list item or blockquote). - -(Indeed, the spec for [list items] and [block quotes] presupposes -this principle.) This principle implies that if - -``` markdown - * I need to buy - - new shoes - - a coat - - a plane ticket -``` - -is a list item containing a paragraph followed by a nested sublist, -as all Markdown implementations agree it is (though the paragraph -may be rendered without `

` tags, since the list is "tight"), -then - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -by itself should be a paragraph followed by a nested sublist. - -Since it is well established Markdown practice to allow lists to -interrupt paragraphs inside list items, the [principle of -uniformity] requires us to allow this outside list items as -well. ([reStructuredText](http://docutils.sourceforge.net/rst.html) -takes a different approach, requiring blank lines before lists -even inside other list items.) - -In order to solve of unwanted lists in paragraphs with -hard-wrapped numerals, we allow only lists starting with `1` to -interrupt paragraphs. Thus, - -```````````````````````````````` example -The number of windows in my house is -14. The number of doors is 6. -. -

The number of windows in my house is -14. The number of doors is 6.

-```````````````````````````````` - -We may still get an unintended result in cases like - -```````````````````````````````` example -The number of windows in my house is -1. The number of doors is 6. -. -

The number of windows in my house is

-
    -
  1. The number of doors is 6.
  2. -
-```````````````````````````````` - -but this rule should prevent most spurious list captures. - -There can be any number of blank lines between items: - -```````````````````````````````` example -- foo - -- bar - - -- baz -. -
    -
  • -

    foo

    -
  • -
  • -

    bar

    -
  • -
  • -

    baz

    -
  • -
-```````````````````````````````` - -```````````````````````````````` example -- foo - - bar - - baz - - - bim -. -
    -
  • foo -
      -
    • bar -
        -
      • -

        baz

        -

        bim

        -
      • -
      -
    • -
    -
  • -
-```````````````````````````````` - - -To separate consecutive lists of the same type, or to separate a -list from an indented code block that would otherwise be parsed -as a subparagraph of the final list item, you can insert a blank HTML -comment: - -```````````````````````````````` example -- foo -- bar - - - -- baz -- bim -. -
    -
  • foo
  • -
  • bar
  • -
- -
    -
  • baz
  • -
  • bim
  • -
-```````````````````````````````` - - -```````````````````````````````` example -- foo - - notcode - -- foo - - - - code -. -
    -
  • -

    foo

    -

    notcode

    -
  • -
  • -

    foo

    -
  • -
- -
code
-
-```````````````````````````````` - - -List items need not be indented to the same level. The following -list items will be treated as items at the same list level, -since none is indented enough to belong to the previous list -item: - -```````````````````````````````` example -- a - - b - - c - - d - - e - - f -- g -. -
    -
  • a
  • -
  • b
  • -
  • c
  • -
  • d
  • -
  • e
  • -
  • f
  • -
  • g
  • -
-```````````````````````````````` - - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -
    -
  1. -

    a

    -
  2. -
  3. -

    b

    -
  4. -
  5. -

    c

    -
  6. -
-```````````````````````````````` - -Note, however, that list items may not be indented more than -three spaces. Here `- e` is treated as a paragraph continuation -line, because it is indented more than three spaces: - -```````````````````````````````` example -- a - - b - - c - - d - - e -. -
    -
  • a
  • -
  • b
  • -
  • c
  • -
  • d -- e
  • -
-```````````````````````````````` - -And here, `3. c` is treated as in indented code block, -because it is indented four spaces and preceded by a -blank line. - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -
    -
  1. -

    a

    -
  2. -
  3. -

    b

    -
  4. -
-
3. c
-
-```````````````````````````````` - - -This is a loose list, because there is a blank line between -two of the list items: - -```````````````````````````````` example -- a -- b - -- c -. -
    -
  • -

    a

    -
  • -
  • -

    b

    -
  • -
  • -

    c

    -
  • -
-```````````````````````````````` - - -So is this, with a empty second item: - -```````````````````````````````` example -* a -* - -* c -. -
    -
  • -

    a

    -
  • -
  • -
  • -

    c

    -
  • -
-```````````````````````````````` - - -These are loose lists, even though there is no space between the items, -because one of the items directly contains two block-level elements -with a blank line between them: - -```````````````````````````````` example -- a -- b - - c -- d -. -
    -
  • -

    a

    -
  • -
  • -

    b

    -

    c

    -
  • -
  • -

    d

    -
  • -
-```````````````````````````````` - - -```````````````````````````````` example -- a -- b - - [ref]: /url -- d -. -
    -
  • -

    a

    -
  • -
  • -

    b

    -
  • -
  • -

    d

    -
  • -
-```````````````````````````````` - - -This is a tight list, because the blank lines are in a code block: - -```````````````````````````````` example -- a -- ``` - b - - - ``` -- c -. -
    -
  • a
  • -
  • -
    b
    -
    -
    -
    -
  • -
  • c
  • -
-```````````````````````````````` - - -This is a tight list, because the blank line is between two -paragraphs of a sublist. So the sublist is loose while -the outer list is tight: - -```````````````````````````````` example -- a - - b - - c -- d -. -
    -
  • a -
      -
    • -

      b

      -

      c

      -
    • -
    -
  • -
  • d
  • -
-```````````````````````````````` - - -This is a tight list, because the blank line is inside the -block quote: - -```````````````````````````````` example -* a - > b - > -* c -. -
    -
  • a -
    -

    b

    -
    -
  • -
  • c
  • -
-```````````````````````````````` - - -This list is tight, because the consecutive block elements -are not separated by blank lines: - -```````````````````````````````` example -- a - > b - ``` - c - ``` -- d -. -
    -
  • a -
    -

    b

    -
    -
    c
    -
    -
  • -
  • d
  • -
-```````````````````````````````` - - -A single-paragraph list is tight: - -```````````````````````````````` example -- a -. -
    -
  • a
  • -
-```````````````````````````````` - - -```````````````````````````````` example -- a - - b -. -
    -
  • a -
      -
    • b
    • -
    -
  • -
-```````````````````````````````` - - -This list is loose, because of the blank line between the -two block elements in the list item: - -```````````````````````````````` example -1. ``` - foo - ``` - - bar -. -
    -
  1. -
    foo
    -
    -

    bar

    -
  2. -
-```````````````````````````````` - - -Here the outer list is loose, the inner list tight: - -```````````````````````````````` example -* foo - * bar - - baz -. -
    -
  • -

    foo

    -
      -
    • bar
    • -
    -

    baz

    -
  • -
-```````````````````````````````` - - -```````````````````````````````` example -- a - - b - - c - -- d - - e - - f -. -
    -
  • -

    a

    -
      -
    • b
    • -
    • c
    • -
    -
  • -
  • -

    d

    -
      -
    • e
    • -
    • f
    • -
    -
  • -
-```````````````````````````````` - - -# Inlines - -Inlines are parsed sequentially from the beginning of the character -stream to the end (left to right, in left-to-right languages). -Thus, for example, in - -```````````````````````````````` example -`hi`lo` -. -

hilo`

-```````````````````````````````` - - -`hi` is parsed as code, leaving the backtick at the end as a literal -backtick. - -## Backslash escapes - -Any ASCII punctuation character may be backslash-escaped: - -```````````````````````````````` example -\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -. -

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

-```````````````````````````````` - - -Backslashes before other characters are treated as literal -backslashes: - -```````````````````````````````` example -\→\A\a\ \3\φ\« -. -

\→\A\a\ \3\φ\«

-```````````````````````````````` - - -Escaped characters are treated as regular characters and do -not have their usual Markdown meanings: - -```````````````````````````````` example -\*not emphasized* -\
not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" -. -

*not emphasized* -<br/> not a tag -[not a link](/foo) -`not code` -1. not a list -* not a list -# not a heading -[foo]: /url "not a reference"

-```````````````````````````````` - - -If a backslash is itself escaped, the following character is not: - -```````````````````````````````` example -\\*emphasis* -. -

\emphasis

-```````````````````````````````` - - -A backslash at the end of the line is a [hard line break]: - -```````````````````````````````` example -foo\ -bar -. -

foo
-bar

-```````````````````````````````` - - -Backslash escapes do not work in code blocks, code spans, autolinks, or -raw HTML: - -```````````````````````````````` example -`` \[\` `` -. -

\[\`

-```````````````````````````````` - - -```````````````````````````````` example - \[\] -. -
\[\]
-
-```````````````````````````````` - - -```````````````````````````````` example -~~~ -\[\] -~~~ -. -
\[\]
-
-```````````````````````````````` - - -```````````````````````````````` example - -. -

http://example.com?find=\*

-```````````````````````````````` - - -```````````````````````````````` example - -. - -```````````````````````````````` - - -But they work in all other contexts, including URLs and link titles, -link references, and [info strings] in [fenced code blocks]: - -```````````````````````````````` example -[foo](/bar\* "ti\*tle") -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /bar\* "ti\*tle" -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -``` foo\+bar -foo -``` -. -
foo
-
-```````````````````````````````` - - - -## Entity and numeric character references - -All valid HTML entity references and numeric character -references, except those occurring in code blocks and code spans, -are recognized as such and treated as equivalent to the -corresponding Unicode characters. Conforming CommonMark parsers -need not store information about whether a particular character -was represented in the source using a Unicode character or -an entity reference. - -[Entity references](@) consist of `&` + any of the valid -HTML5 entity names + `;`. The -document -is used as an authoritative source for the valid entity -references and their corresponding code points. - -```````````````````````````````` example -  & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸ -. -

& © Æ Ď -¾ ℋ ⅆ -∲ ≧̸

-```````````````````````````````` - - -[Decimal numeric character -references](@) -consist of `&#` + a string of 1--7 arabic digits + `;`. A -numeric character reference is parsed as the corresponding -Unicode character. Invalid Unicode code points will be replaced by -the REPLACEMENT CHARACTER (`U+FFFD`). For security reasons, -the code point `U+0000` will also be replaced by `U+FFFD`. - -```````````````````````````````` example -# Ӓ Ϡ � -. -

# Ӓ Ϡ �

-```````````````````````````````` - - -[Hexadecimal numeric character -references](@) consist of `&#` + -either `X` or `x` + a string of 1-6 hexadecimal digits + `;`. -They too are parsed as the corresponding Unicode character (this -time specified with a hexadecimal numeral instead of decimal). - -```````````````````````````````` example -" ആ ಫ -. -

" ആ ಫ

-```````````````````````````````` - - -Here are some nonentities: - -```````````````````````````````` example -  &x; &#; &#x; -� -&#abcdef0; -&ThisIsNotDefined; &hi?; -. -

&nbsp &x; &#; &#x; -&#987654321; -&#abcdef0; -&ThisIsNotDefined; &hi?;

-```````````````````````````````` - - -Although HTML5 does accept some entity references -without a trailing semicolon (such as `©`), these are not -recognized here, because it makes the grammar too ambiguous: - -```````````````````````````````` example -© -. -

&copy

-```````````````````````````````` - - -Strings that are not on the list of HTML5 named entities are not -recognized as entity references either: - -```````````````````````````````` example -&MadeUpEntity; -. -

&MadeUpEntity;

-```````````````````````````````` - - -Entity and numeric character references are recognized in any -context besides code spans or code blocks, including -URLs, [link titles], and [fenced code block][] [info strings]: - -```````````````````````````````` example - -. - -```````````````````````````````` - - -```````````````````````````````` example -[foo](/föö "föö") -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /föö "föö" -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -``` föö -foo -``` -. -
foo
-
-```````````````````````````````` - - -Entity and numeric character references are treated as literal -text in code spans and code blocks: - -```````````````````````````````` example -`föö` -. -

f&ouml;&ouml;

-```````````````````````````````` - - -```````````````````````````````` example - föfö -. -
f&ouml;f&ouml;
-
-```````````````````````````````` - - -## Code spans - -A [backtick string](@) -is a string of one or more backtick characters (`` ` ``) that is neither -preceded nor followed by a backtick. - -A [code span](@) begins with a backtick string and ends with -a backtick string of equal length. The contents of the code span are -the characters between the two backtick strings, normalized in the -following ways: - -- First, [line endings] are converted to [spaces]. -- If the resulting string both begins *and* ends with a [space] - character, a single [space] character is removed from the - front and back. This allows you to include code that begins - or ends with backtick characters, which must be separated by - whitespace from the opening or closing backtick strings. - -This is a simple code span: - -```````````````````````````````` example -`foo` -. -

foo

-```````````````````````````````` - - -Here two backticks are used, because the code contains a backtick. -This example also illustrates stripping of a single leading and -trailing space: - -```````````````````````````````` example -`` foo ` bar `` -. -

foo ` bar

-```````````````````````````````` - - -This example shows the motivation for stripping leading and trailing -spaces: - -```````````````````````````````` example -` `` ` -. -

``

-```````````````````````````````` - -Note that only *one* space is stripped: - -```````````````````````````````` example -` `` ` -. -

``

-```````````````````````````````` - -The stripping only happens if the space is on both -sides of the string: - -```````````````````````````````` example -` a` -. -

a

-```````````````````````````````` - -Only [spaces], and not [unicode whitespace] in general, are -stripped in this way: - -```````````````````````````````` example -` b ` -. -

b

-```````````````````````````````` - - -[Line endings] are treated like spaces: - -```````````````````````````````` example -`` -foo -bar -baz -`` -. -

foo bar baz

-```````````````````````````````` - -```````````````````````````````` example -`` -foo -`` -. -

foo

-```````````````````````````````` - - -Interior spaces are not collapsed: - -```````````````````````````````` example -`foo bar -baz` -. -

foo bar baz

-```````````````````````````````` - -Note that browsers will typically collapse consecutive spaces -when rendering `` elements, so it is recommended that -the following CSS be used: - - code{white-space: pre-wrap;} - - -Note that backslash escapes do not work in code spans. All backslashes -are treated literally: - -```````````````````````````````` example -`foo\`bar` -. -

foo\bar`

-```````````````````````````````` - - -Backslash escapes are never needed, because one can always choose a -string of *n* backtick characters as delimiters, where the code does -not contain any strings of exactly *n* backtick characters. - -```````````````````````````````` example -``foo`bar`` -. -

foo`bar

-```````````````````````````````` - -```````````````````````````````` example -` foo `` bar ` -. -

foo `` bar

-```````````````````````````````` - - -Code span backticks have higher precedence than any other inline -constructs except HTML tags and autolinks. Thus, for example, this is -not parsed as emphasized text, since the second `*` is part of a code -span: - -```````````````````````````````` example -*foo`*` -. -

*foo*

-```````````````````````````````` - - -And this is not parsed as a link: - -```````````````````````````````` example -[not a `link](/foo`) -. -

[not a link](/foo)

-```````````````````````````````` - - -Code spans, HTML tags, and autolinks have the same precedence. -Thus, this is code: - -```````````````````````````````` example -`` -. -

<a href="">`

-```````````````````````````````` - - -But this is an HTML tag: - -```````````````````````````````` example -
` -. -

`

-```````````````````````````````` - - -And this is code: - -```````````````````````````````` example -`` -. -

<http://foo.bar.baz>`

-```````````````````````````````` - - -But this is an autolink: - -```````````````````````````````` example -` -. -

http://foo.bar.`baz`

-```````````````````````````````` - - -When a backtick string is not closed by a matching backtick string, -we just have literal backticks: - -```````````````````````````````` example -```foo`` -. -

```foo``

-```````````````````````````````` - - -```````````````````````````````` example -`foo -. -

`foo

-```````````````````````````````` - -The following case also illustrates the need for opening and -closing backtick strings to be equal in length: - -```````````````````````````````` example -`foo``bar`` -. -

`foobar

-```````````````````````````````` - - -## Emphasis and strong emphasis - -John Gruber's original [Markdown syntax -description](http://daringfireball.net/projects/markdown/syntax#em) says: - -> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -> emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML -> `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` -> tag. - -This is enough for most users, but these rules leave much undecided, -especially when it comes to nested emphasis. The original -`Markdown.pl` test suite makes it clear that triple `***` and -`___` delimiters can be used for strong emphasis, and most -implementations have also allowed the following patterns: - -``` markdown -***strong emph*** -***strong** in emph* -***emph* in strong** -**in strong *emph*** -*in emph **strong*** -``` - -The following patterns are less widely supported, but the intent -is clear and they are useful (especially in contexts like bibliography -entries): - -``` markdown -*emph *with emph* in it* -**strong **with strong** in it** -``` - -Many implementations have also restricted intraword emphasis to -the `*` forms, to avoid unwanted emphasis in words containing -internal underscores. (It is best practice to put these in code -spans, but users often do not.) - -``` markdown -internal emphasis: foo*bar*baz -no emphasis: foo_bar_baz -``` - -The rules given below capture all of these patterns, while allowing -for efficient parsing strategies that do not backtrack. - -First, some definitions. A [delimiter run](@) is either -a sequence of one or more `*` characters that is not preceded or -followed by a non-backslash-escaped `*` character, or a sequence -of one or more `_` characters that is not preceded or followed by -a non-backslash-escaped `_` character. - -A [left-flanking delimiter run](@) is -a [delimiter run] that is (1) not followed by [Unicode whitespace], -and either (2a) not followed by a [punctuation character], or -(2b) followed by a [punctuation character] and -preceded by [Unicode whitespace] or a [punctuation character]. -For purposes of this definition, the beginning and the end of -the line count as Unicode whitespace. - -A [right-flanking delimiter run](@) is -a [delimiter run] that is (1) not preceded by [Unicode whitespace], -and either (2a) not preceded by a [punctuation character], or -(2b) preceded by a [punctuation character] and -followed by [Unicode whitespace] or a [punctuation character]. -For purposes of this definition, the beginning and the end of -the line count as Unicode whitespace. - -Here are some examples of delimiter runs. - - - left-flanking but not right-flanking: - - ``` - ***abc - _abc - **"abc" - _"abc" - ``` - - - right-flanking but not left-flanking: - - ``` - abc*** - abc_ - "abc"** - "abc"_ - ``` - - - Both left and right-flanking: - - ``` - abc***def - "abc"_"def" - ``` - - - Neither left nor right-flanking: - - ``` - abc *** def - a _ b - ``` - -(The idea of distinguishing left-flanking and right-flanking -delimiter runs based on the character before and the character -after comes from Roopesh Chander's -[vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags). -vfmd uses the terminology "emphasis indicator string" instead of "delimiter -run," and its rules for distinguishing left- and right-flanking runs -are a bit more complex than the ones given here.) - -The following rules define emphasis and strong emphasis: - -1. A single `*` character [can open emphasis](@) - iff (if and only if) it is part of a [left-flanking delimiter run]. - -2. A single `_` character [can open emphasis] iff - it is part of a [left-flanking delimiter run] - and either (a) not part of a [right-flanking delimiter run] - or (b) part of a [right-flanking delimiter run] - preceded by punctuation. - -3. A single `*` character [can close emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -4. A single `_` character [can close emphasis] iff - it is part of a [right-flanking delimiter run] - and either (a) not part of a [left-flanking delimiter run] - or (b) part of a [left-flanking delimiter run] - followed by punctuation. - -5. A double `**` [can open strong emphasis](@) - iff it is part of a [left-flanking delimiter run]. - -6. A double `__` [can open strong emphasis] iff - it is part of a [left-flanking delimiter run] - and either (a) not part of a [right-flanking delimiter run] - or (b) part of a [right-flanking delimiter run] - preceded by punctuation. - -7. A double `**` [can close strong emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -8. A double `__` [can close strong emphasis] iff - it is part of a [right-flanking delimiter run] - and either (a) not part of a [left-flanking delimiter run] - or (b) part of a [left-flanking delimiter run] - followed by punctuation. - -9. Emphasis begins with a delimiter that [can open emphasis] and ends - with a delimiter that [can close emphasis], and that uses the same - character (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both - open and close emphasis, then the sum of the lengths of the - delimiter runs containing the opening and closing delimiters - must not be a multiple of 3. - -10. Strong emphasis begins with a delimiter that - [can open strong emphasis] and ends with a delimiter that - [can close strong emphasis], and that uses the same character - (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both open - and close strong emphasis, then the sum of the lengths of - the delimiter runs containing the opening and closing - delimiters must not be a multiple of 3. - -11. A literal `*` character cannot occur at the beginning or end of - `*`-delimited emphasis or `**`-delimited strong emphasis, unless it - is backslash-escaped. - -12. A literal `_` character cannot occur at the beginning or end of - `_`-delimited emphasis or `__`-delimited strong emphasis, unless it - is backslash-escaped. - -Where rules 1--12 above are compatible with multiple parsings, -the following principles resolve ambiguity: - -13. The number of nestings should be minimized. Thus, for example, - an interpretation `...` is always preferred to - `...`. - -14. An interpretation `...` is always - preferred to `...`. - -15. When two potential emphasis or strong emphasis spans overlap, - so that the second begins before the first ends and ends after - the first ends, the first takes precedence. Thus, for example, - `*foo _bar* baz_` is parsed as `foo _bar baz_` rather - than `*foo bar* baz`. - -16. When there are two potential emphasis or strong emphasis spans - with the same closing delimiter, the shorter one (the one that - opens later) takes precedence. Thus, for example, - `**foo **bar baz**` is parsed as `**foo bar baz` - rather than `foo **bar baz`. - -17. Inline code spans, links, images, and HTML tags group more tightly - than emphasis. So, when there is a choice between an interpretation - that contains one of these elements and one that does not, the - former always wins. Thus, for example, `*[foo*](bar)` is - parsed as `*foo*` rather than as - `[foo](bar)`. - -These rules can be illustrated through a series of examples. - -Rule 1: - -```````````````````````````````` example -*foo bar* -. -

foo bar

-```````````````````````````````` - - -This is not emphasis, because the opening `*` is followed by -whitespace, and hence not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a * foo bar* -. -

a * foo bar*

-```````````````````````````````` - - -This is not emphasis, because the opening `*` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a*"foo"* -. -

a*"foo"*

-```````````````````````````````` - - -Unicode nonbreaking spaces count as whitespace, too: - -```````````````````````````````` example -* a * -. -

* a *

-```````````````````````````````` - - -Intraword emphasis with `*` is permitted: - -```````````````````````````````` example -foo*bar* -. -

foobar

-```````````````````````````````` - - -```````````````````````````````` example -5*6*78 -. -

5678

-```````````````````````````````` - - -Rule 2: - -```````````````````````````````` example -_foo bar_ -. -

foo bar

-```````````````````````````````` - - -This is not emphasis, because the opening `_` is followed by -whitespace: - -```````````````````````````````` example -_ foo bar_ -. -

_ foo bar_

-```````````````````````````````` - - -This is not emphasis, because the opening `_` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a_"foo"_ -. -

a_"foo"_

-```````````````````````````````` - - -Emphasis with `_` is not allowed inside words: - -```````````````````````````````` example -foo_bar_ -. -

foo_bar_

-```````````````````````````````` - - -```````````````````````````````` example -5_6_78 -. -

5_6_78

-```````````````````````````````` - - -```````````````````````````````` example -пристаням_стремятся_ -. -

пристаням_стремятся_

-```````````````````````````````` - - -Here `_` does not generate emphasis, because the first delimiter run -is right-flanking and the second left-flanking: - -```````````````````````````````` example -aa_"bb"_cc -. -

aa_"bb"_cc

-```````````````````````````````` - - -This is emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-_(bar)_ -. -

foo-(bar)

-```````````````````````````````` - - -Rule 3: - -This is not emphasis, because the closing delimiter does -not match the opening delimiter: - -```````````````````````````````` example -_foo* -. -

_foo*

-```````````````````````````````` - - -This is not emphasis, because the closing `*` is preceded by -whitespace: - -```````````````````````````````` example -*foo bar * -. -

*foo bar *

-```````````````````````````````` - - -A newline also counts as whitespace: - -```````````````````````````````` example -*foo bar -* -. -

*foo bar -*

-```````````````````````````````` - - -This is not emphasis, because the second `*` is -preceded by punctuation and followed by an alphanumeric -(hence it is not part of a [right-flanking delimiter run]: - -```````````````````````````````` example -*(*foo) -. -

*(*foo)

-```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -*(*foo*)* -. -

(foo)

-```````````````````````````````` - - -Intraword emphasis with `*` is allowed: - -```````````````````````````````` example -*foo*bar -. -

foobar

-```````````````````````````````` - - - -Rule 4: - -This is not emphasis, because the closing `_` is preceded by -whitespace: - -```````````````````````````````` example -_foo bar _ -. -

_foo bar _

-```````````````````````````````` - - -This is not emphasis, because the second `_` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -_(_foo) -. -

_(_foo)

-```````````````````````````````` - - -This is emphasis within emphasis: - -```````````````````````````````` example -_(_foo_)_ -. -

(foo)

-```````````````````````````````` - - -Intraword emphasis is disallowed for `_`: - -```````````````````````````````` example -_foo_bar -. -

_foo_bar

-```````````````````````````````` - - -```````````````````````````````` example -_пристаням_стремятся -. -

_пристаням_стремятся

-```````````````````````````````` - - -```````````````````````````````` example -_foo_bar_baz_ -. -

foo_bar_baz

-```````````````````````````````` - - -This is emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -_(bar)_. -. -

(bar).

-```````````````````````````````` - - -Rule 5: - -```````````````````````````````` example -**foo bar** -. -

foo bar

-```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -** foo bar** -. -

** foo bar**

-```````````````````````````````` - - -This is not strong emphasis, because the opening `**` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a**"foo"** -. -

a**"foo"**

-```````````````````````````````` - - -Intraword strong emphasis with `**` is permitted: - -```````````````````````````````` example -foo**bar** -. -

foobar

-```````````````````````````````` - - -Rule 6: - -```````````````````````````````` example -__foo bar__ -. -

foo bar

-```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -__ foo bar__ -. -

__ foo bar__

-```````````````````````````````` - - -A newline counts as whitespace: -```````````````````````````````` example -__ -foo bar__ -. -

__ -foo bar__

-```````````````````````````````` - - -This is not strong emphasis, because the opening `__` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a__"foo"__ -. -

a__"foo"__

-```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -foo__bar__ -. -

foo__bar__

-```````````````````````````````` - - -```````````````````````````````` example -5__6__78 -. -

5__6__78

-```````````````````````````````` - - -```````````````````````````````` example -пристаням__стремятся__ -. -

пристаням__стремятся__

-```````````````````````````````` - - -```````````````````````````````` example -__foo, __bar__, baz__ -. -

foo, bar, baz

-```````````````````````````````` - - -This is strong emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-__(bar)__ -. -

foo-(bar)

-```````````````````````````````` - - - -Rule 7: - -This is not strong emphasis, because the closing delimiter is preceded -by whitespace: - -```````````````````````````````` example -**foo bar ** -. -

**foo bar **

-```````````````````````````````` - - -(Nor can it be interpreted as an emphasized `*foo bar *`, because of -Rule 11.) - -This is not strong emphasis, because the second `**` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -**(**foo) -. -

**(**foo)

-```````````````````````````````` - - -The point of this restriction is more easily appreciated -with these examples: - -```````````````````````````````` example -*(**foo**)* -. -

(foo)

-```````````````````````````````` - - -```````````````````````````````` example -**Gomphocarpus (*Gomphocarpus physocarpus*, syn. -*Asclepias physocarpa*)** -. -

Gomphocarpus (Gomphocarpus physocarpus, syn. -Asclepias physocarpa)

-```````````````````````````````` - - -```````````````````````````````` example -**foo "*bar*" foo** -. -

foo "bar" foo

-```````````````````````````````` - - -Intraword emphasis: - -```````````````````````````````` example -**foo**bar -. -

foobar

-```````````````````````````````` - - -Rule 8: - -This is not strong emphasis, because the closing delimiter is -preceded by whitespace: - -```````````````````````````````` example -__foo bar __ -. -

__foo bar __

-```````````````````````````````` - - -This is not strong emphasis, because the second `__` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -__(__foo) -. -

__(__foo)

-```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -_(__foo__)_ -. -

(foo)

-```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -__foo__bar -. -

__foo__bar

-```````````````````````````````` - - -```````````````````````````````` example -__пристаням__стремятся -. -

__пристаням__стремятся

-```````````````````````````````` - - -```````````````````````````````` example -__foo__bar__baz__ -. -

foo__bar__baz

-```````````````````````````````` - - -This is strong emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -__(bar)__. -. -

(bar).

-```````````````````````````````` - - -Rule 9: - -Any nonempty sequence of inline elements can be the contents of an -emphasized span. - -```````````````````````````````` example -*foo [bar](/url)* -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -*foo -bar* -. -

foo -bar

-```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside emphasis: - -```````````````````````````````` example -_foo __bar__ baz_ -. -

foo bar baz

-```````````````````````````````` - - -```````````````````````````````` example -_foo _bar_ baz_ -. -

foo bar baz

-```````````````````````````````` - - -```````````````````````````````` example -__foo_ bar_ -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -*foo *bar** -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -*foo **bar** baz* -. -

foo bar baz

-```````````````````````````````` - -```````````````````````````````` example -*foo**bar**baz* -. -

foobarbaz

-```````````````````````````````` - -Note that in the preceding case, the interpretation - -``` markdown -

foobarbaz

-``` - - -is precluded by the condition that a delimiter that -can both open and close (like the `*` after `foo`) -cannot form emphasis if the sum of the lengths of -the delimiter runs containing the opening and -closing delimiters is a multiple of 3. - - -For the same reason, we don't get two consecutive -emphasis sections in this example: - -```````````````````````````````` example -*foo**bar* -. -

foo**bar

-```````````````````````````````` - - -The same condition ensures that the following -cases are all strong emphasis nested inside -emphasis, even when the interior spaces are -omitted: - - -```````````````````````````````` example -***foo** bar* -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -*foo **bar*** -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -*foo**bar*** -. -

foobar

-```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -*foo **bar *baz* bim** bop* -. -

foo bar baz bim bop

-```````````````````````````````` - - -```````````````````````````````` example -*foo [*bar*](/url)* -. -

foo bar

-```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -** is not an empty emphasis -. -

** is not an empty emphasis

-```````````````````````````````` - - -```````````````````````````````` example -**** is not an empty strong emphasis -. -

**** is not an empty strong emphasis

-```````````````````````````````` - - - -Rule 10: - -Any nonempty sequence of inline elements can be the contents of an -strongly emphasized span. - -```````````````````````````````` example -**foo [bar](/url)** -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -**foo -bar** -. -

foo -bar

-```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside strong emphasis: - -```````````````````````````````` example -__foo _bar_ baz__ -. -

foo bar baz

-```````````````````````````````` - - -```````````````````````````````` example -__foo __bar__ baz__ -. -

foo bar baz

-```````````````````````````````` - - -```````````````````````````````` example -____foo__ bar__ -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -**foo **bar**** -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -**foo *bar* baz** -. -

foo bar baz

-```````````````````````````````` - - -```````````````````````````````` example -**foo*bar*baz** -. -

foobarbaz

-```````````````````````````````` - - -```````````````````````````````` example -***foo* bar** -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -**foo *bar*** -. -

foo bar

-```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -**foo *bar **baz** -bim* bop** -. -

foo bar baz -bim bop

-```````````````````````````````` - - -```````````````````````````````` example -**foo [*bar*](/url)** -. -

foo bar

-```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -__ is not an empty emphasis -. -

__ is not an empty emphasis

-```````````````````````````````` - - -```````````````````````````````` example -____ is not an empty strong emphasis -. -

____ is not an empty strong emphasis

-```````````````````````````````` - - - -Rule 11: - -```````````````````````````````` example -foo *** -. -

foo ***

-```````````````````````````````` - - -```````````````````````````````` example -foo *\** -. -

foo *

-```````````````````````````````` - - -```````````````````````````````` example -foo *_* -. -

foo _

-```````````````````````````````` - - -```````````````````````````````` example -foo ***** -. -

foo *****

-```````````````````````````````` - - -```````````````````````````````` example -foo **\*** -. -

foo *

-```````````````````````````````` - - -```````````````````````````````` example -foo **_** -. -

foo _

-```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 11 determines -that the excess literal `*` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -**foo* -. -

*foo

-```````````````````````````````` - - -```````````````````````````````` example -*foo** -. -

foo*

-```````````````````````````````` - - -```````````````````````````````` example -***foo** -. -

*foo

-```````````````````````````````` - - -```````````````````````````````` example -****foo* -. -

***foo

-```````````````````````````````` - - -```````````````````````````````` example -**foo*** -. -

foo*

-```````````````````````````````` - - -```````````````````````````````` example -*foo**** -. -

foo***

-```````````````````````````````` - - - -Rule 12: - -```````````````````````````````` example -foo ___ -. -

foo ___

-```````````````````````````````` - - -```````````````````````````````` example -foo _\__ -. -

foo _

-```````````````````````````````` - - -```````````````````````````````` example -foo _*_ -. -

foo *

-```````````````````````````````` - - -```````````````````````````````` example -foo _____ -. -

foo _____

-```````````````````````````````` - - -```````````````````````````````` example -foo __\___ -. -

foo _

-```````````````````````````````` - - -```````````````````````````````` example -foo __*__ -. -

foo *

-```````````````````````````````` - - -```````````````````````````````` example -__foo_ -. -

_foo

-```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 12 determines -that the excess literal `_` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -_foo__ -. -

foo_

-```````````````````````````````` - - -```````````````````````````````` example -___foo__ -. -

_foo

-```````````````````````````````` - - -```````````````````````````````` example -____foo_ -. -

___foo

-```````````````````````````````` - - -```````````````````````````````` example -__foo___ -. -

foo_

-```````````````````````````````` - - -```````````````````````````````` example -_foo____ -. -

foo___

-```````````````````````````````` - - -Rule 13 implies that if you want emphasis nested directly inside -emphasis, you must use different delimiters: - -```````````````````````````````` example -**foo** -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -*_foo_* -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -__foo__ -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -_*foo*_ -. -

foo

-```````````````````````````````` - - -However, strong emphasis within strong emphasis is possible without -switching delimiters: - -```````````````````````````````` example -****foo**** -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -____foo____ -. -

foo

-```````````````````````````````` - - - -Rule 13 can be applied to arbitrarily long sequences of -delimiters: - -```````````````````````````````` example -******foo****** -. -

foo

-```````````````````````````````` - - -Rule 14: - -```````````````````````````````` example -***foo*** -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -_____foo_____ -. -

foo

-```````````````````````````````` - - -Rule 15: - -```````````````````````````````` example -*foo _bar* baz_ -. -

foo _bar baz_

-```````````````````````````````` - - -```````````````````````````````` example -*foo __bar *baz bim__ bam* -. -

foo bar *baz bim bam

-```````````````````````````````` - - -Rule 16: - -```````````````````````````````` example -**foo **bar baz** -. -

**foo bar baz

-```````````````````````````````` - - -```````````````````````````````` example -*foo *bar baz* -. -

*foo bar baz

-```````````````````````````````` - - -Rule 17: - -```````````````````````````````` example -*[bar*](/url) -. -

*bar*

-```````````````````````````````` - - -```````````````````````````````` example -_foo [bar_](/url) -. -

_foo bar_

-```````````````````````````````` - - -```````````````````````````````` example -* -. -

*

-```````````````````````````````` - - -```````````````````````````````` example -** -. -

**

-```````````````````````````````` - - -```````````````````````````````` example -__ -. -

__

-```````````````````````````````` - - -```````````````````````````````` example -*a `*`* -. -

a *

-```````````````````````````````` - - -```````````````````````````````` example -_a `_`_ -. -

a _

-```````````````````````````````` - - -```````````````````````````````` example -**a -. -

**ahttp://foo.bar/?q=**

-```````````````````````````````` - - -```````````````````````````````` example -__a -. -

__ahttp://foo.bar/?q=__

-```````````````````````````````` - - - -## Links - -A link contains [link text] (the visible text), a [link destination] -(the URI that is the link destination), and optionally a [link title]. -There are two basic kinds of links in Markdown. In [inline links] the -destination and title are given immediately after the link text. In -[reference links] the destination and title are defined elsewhere in -the document. - -A [link text](@) consists of a sequence of zero or more -inline elements enclosed by square brackets (`[` and `]`). The -following rules apply: - -- Links may not contain other links, at any level of nesting. If - multiple otherwise valid link definitions appear nested inside each - other, the inner-most definition is used. - -- Brackets are allowed in the [link text] only if (a) they - are backslash-escaped or (b) they appear as a matched pair of brackets, - with an open bracket `[`, a sequence of zero or more inlines, and - a close bracket `]`. - -- Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly - than the brackets in link text. Thus, for example, - `` [foo`]` `` could not be a link text, since the second `]` - is part of a code span. - -- The brackets in link text bind more tightly than markers for - [emphasis and strong emphasis]. Thus, for example, `*[foo*](url)` is a link. - -A [link destination](@) consists of either - -- a sequence of zero or more characters between an opening `<` and a - closing `>` that contains no line breaks or unescaped - `<` or `>` characters, or - -- a nonempty sequence of characters that does not include - ASCII space or control characters, and includes parentheses - only if (a) they are backslash-escaped or (b) they are part of - a balanced pair of unescaped parentheses. (Implementations - may impose limits on parentheses nesting to avoid performance - issues, but at least three levels of nesting should be supported.) - -A [link title](@) consists of either - -- a sequence of zero or more characters between straight double-quote - characters (`"`), including a `"` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between straight single-quote - characters (`'`), including a `'` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between matching parentheses - (`(...)`), including a `)` character only if it is backslash-escaped. - -Although [link titles] may span multiple lines, they may not contain -a [blank line]. - -An [inline link](@) consists of a [link text] followed immediately -by a left parenthesis `(`, optional [whitespace], an optional -[link destination], an optional [link title] separated from the link -destination by [whitespace], optional [whitespace], and a right -parenthesis `)`. The link's text consists of the inlines contained -in the [link text] (excluding the enclosing square brackets). -The link's URI consists of the link destination, excluding enclosing -`<...>` if present, with backslash-escapes in effect as described -above. The link's title consists of the link title, excluding its -enclosing delimiters, with backslash-escapes in effect as described -above. - -Here is a simple inline link: - -```````````````````````````````` example -[link](/uri "title") -. -

link

-```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[link](/uri) -. -

link

-```````````````````````````````` - - -Both the title and the destination may be omitted: - -```````````````````````````````` example -[link]() -. -

link

-```````````````````````````````` - - -```````````````````````````````` example -[link](<>) -. -

link

-```````````````````````````````` - -The destination can only contain spaces if it is -enclosed in pointy brackets: - -```````````````````````````````` example -[link](/my uri) -. -

[link](/my uri)

-```````````````````````````````` - -```````````````````````````````` example -[link](
) -. -

link

-```````````````````````````````` - -The destination cannot contain line breaks, -even if enclosed in pointy brackets: - -```````````````````````````````` example -[link](foo -bar) -. -

[link](foo -bar)

-```````````````````````````````` - -```````````````````````````````` example -[link]() -. -

[link]()

-```````````````````````````````` - -Parentheses inside the link destination may be escaped: - -```````````````````````````````` example -[link](\(foo\)) -. -

link

-```````````````````````````````` - -Any number of parentheses are allowed without escaping, as long as they are -balanced: - -```````````````````````````````` example -[link](foo(and(bar))) -. -

link

-```````````````````````````````` - -However, if you have unbalanced parentheses, you need to escape or use the -`<...>` form: - -```````````````````````````````` example -[link](foo\(and\(bar\)) -. -

link

-```````````````````````````````` - - -```````````````````````````````` example -[link]() -. -

link

-```````````````````````````````` - - -Parentheses and other symbols can also be escaped, as usual -in Markdown: - -```````````````````````````````` example -[link](foo\)\:) -. -

link

-```````````````````````````````` - - -A link can contain fragment identifiers and queries: - -```````````````````````````````` example -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) -. -

link

-

link

-

link

-```````````````````````````````` - - -Note that a backslash before a non-escapable character is -just a backslash: - -```````````````````````````````` example -[link](foo\bar) -. -

link

-```````````````````````````````` - - -URL-escaping should be left alone inside the destination, as all -URL-escaped characters are also valid URL characters. Entity and -numerical character references in the destination will be parsed -into the corresponding Unicode code points, as usual. These may -be optionally URL-escaped when written as HTML, but this spec -does not enforce any particular policy for rendering URLs in -HTML or other formats. Renderers may make different decisions -about how to escape or normalize URLs in the output. - -```````````````````````````````` example -[link](foo%20bä) -. -

link

-```````````````````````````````` - - -Note that, because titles can often be parsed as destinations, -if you try to omit the destination and keep the title, you'll -get unexpected results: - -```````````````````````````````` example -[link]("title") -. -

link

-```````````````````````````````` - - -Titles may be in single quotes, double quotes, or parentheses: - -```````````````````````````````` example -[link](/url "title") -[link](/url 'title') -[link](/url (title)) -. -

link -link -link

-```````````````````````````````` - - -Backslash escapes and entity and numeric character references -may be used in titles: - -```````````````````````````````` example -[link](/url "title \""") -. -

link

-```````````````````````````````` - - -Titles must be separated from the link using a [whitespace]. -Other [Unicode whitespace] like non-breaking space doesn't work. - -```````````````````````````````` example -[link](/url "title") -. -

link

-```````````````````````````````` - - -Nested balanced quotes are not allowed without escaping: - -```````````````````````````````` example -[link](/url "title "and" title") -. -

[link](/url "title "and" title")

-```````````````````````````````` - - -But it is easy to work around this by using a different quote type: - -```````````````````````````````` example -[link](/url 'title "and" title') -. -

link

-```````````````````````````````` - - -(Note: `Markdown.pl` did allow double quotes inside a double-quoted -title, and its test suite included a test demonstrating this. -But it is hard to see a good rationale for the extra complexity this -brings, since there are already many ways---backslash escaping, -entity and numeric character references, or using a different -quote type for the enclosing title---to write titles containing -double quotes. `Markdown.pl`'s handling of titles has a number -of other strange features. For example, it allows single-quoted -titles in inline links, but not reference links. And, in -reference links but not inline links, it allows a title to begin -with `"` and end with `)`. `Markdown.pl` 1.0.1 even allows -titles with no closing quotation mark, though 1.0.2b8 does not. -It seems preferable to adopt a simple, rational rule that works -the same way in inline links and link reference definitions.) - -[Whitespace] is allowed around the destination and title: - -```````````````````````````````` example -[link]( /uri - "title" ) -. -

link

-```````````````````````````````` - - -But it is not allowed between the link text and the -following parenthesis: - -```````````````````````````````` example -[link] (/uri) -. -

[link] (/uri)

-```````````````````````````````` - - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]](/uri) -. -

link [foo [bar]]

-```````````````````````````````` - - -```````````````````````````````` example -[link] bar](/uri) -. -

[link] bar](/uri)

-```````````````````````````````` - - -```````````````````````````````` example -[link [bar](/uri) -. -

[link bar

-```````````````````````````````` - - -```````````````````````````````` example -[link \[bar](/uri) -. -

link [bar

-```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*](/uri) -. -

link foo bar #

-```````````````````````````````` - - -```````````````````````````````` example -[![moon](moon.jpg)](/uri) -. -

moon

-```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)](/uri) -. -

[foo bar](/uri)

-```````````````````````````````` - - -```````````````````````````````` example -[foo *[bar [baz](/uri)](/uri)*](/uri) -. -

[foo [bar baz](/uri)](/uri)

-```````````````````````````````` - - -```````````````````````````````` example -![[[foo](uri1)](uri2)](uri3) -. -

[foo](uri2)

-```````````````````````````````` - - -These cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*](/uri) -. -

*foo*

-```````````````````````````````` - - -```````````````````````````````` example -[foo *bar](baz*) -. -

foo *bar

-```````````````````````````````` - - -Note that brackets that *aren't* part of links do not take -precedence: - -```````````````````````````````` example -*foo [bar* baz] -. -

foo [bar baz]

-```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo -. -

[foo

-```````````````````````````````` - - -```````````````````````````````` example -[foo`](/uri)` -. -

[foo](/uri)

-```````````````````````````````` - - -```````````````````````````````` example -[foo -. -

[foohttp://example.com/?search=](uri)

-```````````````````````````````` - - -There are three kinds of [reference link](@)s: -[full](#full-reference-link), [collapsed](#collapsed-reference-link), -and [shortcut](#shortcut-reference-link). - -A [full reference link](@) -consists of a [link text] immediately followed by a [link label] -that [matches] a [link reference definition] elsewhere in the document. - -A [link label](@) begins with a left bracket (`[`) and ends -with the first right bracket (`]`) that is not backslash-escaped. -Between these brackets there must be at least one [non-whitespace character]. -Unescaped square bracket characters are not allowed inside the -opening and closing square brackets of [link labels]. A link -label can have at most 999 characters inside the square -brackets. - -One label [matches](@) -another just in case their normalized forms are equal. To normalize a -label, strip off the opening and closing brackets, -perform the *Unicode case fold*, strip leading and trailing -[whitespace] and collapse consecutive internal -[whitespace] to a single space. If there are multiple -matching reference link definitions, the one that comes first in the -document is used. (It is desirable in such cases to emit a warning.) - -The contents of the first link label are parsed as inlines, which are -used as the link's text. The link's URI and title are provided by the -matching [link reference definition]. - -Here is a simple example: - -```````````````````````````````` example -[foo][bar] - -[bar]: /url "title" -. -

foo

-```````````````````````````````` - - -The rules for the [link text] are the same as with -[inline links]. Thus: - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]][ref] - -[ref]: /uri -. -

link [foo [bar]]

-```````````````````````````````` - - -```````````````````````````````` example -[link \[bar][ref] - -[ref]: /uri -. -

link [bar

-```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*][ref] - -[ref]: /uri -. -

link foo bar #

-```````````````````````````````` - - -```````````````````````````````` example -[![moon](moon.jpg)][ref] - -[ref]: /uri -. -

moon

-```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)][ref] - -[ref]: /uri -. -

[foo bar]ref

-```````````````````````````````` - - -```````````````````````````````` example -[foo *bar [baz][ref]*][ref] - -[ref]: /uri -. -

[foo bar baz]ref

-```````````````````````````````` - - -(In the examples above, we have two [shortcut reference links] -instead of one [full reference link].) - -The following cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*][ref] - -[ref]: /uri -. -

*foo*

-```````````````````````````````` - - -```````````````````````````````` example -[foo *bar][ref] - -[ref]: /uri -. -

foo *bar

-```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo - -[ref]: /uri -. -

[foo

-```````````````````````````````` - - -```````````````````````````````` example -[foo`][ref]` - -[ref]: /uri -. -

[foo][ref]

-```````````````````````````````` - - -```````````````````````````````` example -[foo - -[ref]: /uri -. -

[foohttp://example.com/?search=][ref]

-```````````````````````````````` - - -Matching is case-insensitive: - -```````````````````````````````` example -[foo][BaR] - -[bar]: /url "title" -. -

foo

-```````````````````````````````` - - -Unicode case fold is used: - -```````````````````````````````` example -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url -. -

Толпой is a Russian word.

-```````````````````````````````` - - -Consecutive internal [whitespace] is treated as one space for -purposes of determining matching: - -```````````````````````````````` example -[Foo - bar]: /url - -[Baz][Foo bar] -. -

Baz

-```````````````````````````````` - - -No [whitespace] is allowed between the [link text] and the -[link label]: - -```````````````````````````````` example -[foo] [bar] - -[bar]: /url "title" -. -

[foo] bar

-```````````````````````````````` - - -```````````````````````````````` example -[foo] -[bar] - -[bar]: /url "title" -. -

[foo] -bar

-```````````````````````````````` - - -This is a departure from John Gruber's original Markdown syntax -description, which explicitly allows whitespace between the link -text and the link label. It brings reference links in line with -[inline links], which (according to both original Markdown and -this spec) cannot have whitespace after the link text. More -importantly, it prevents inadvertent capture of consecutive -[shortcut reference links]. If whitespace is allowed between the -link text and the link label, then in the following we will have -a single reference link, not two shortcut reference links, as -intended: - -``` markdown -[foo] -[bar] - -[foo]: /url1 -[bar]: /url2 -``` - -(Note that [shortcut reference links] were introduced by Gruber -himself in a beta version of `Markdown.pl`, but never included -in the official syntax description. Without shortcut reference -links, it is harmless to allow space between the link text and -link label; but once shortcut references are introduced, it is -too dangerous to allow this, as it frequently leads to -unintended results.) - -When there are multiple matching [link reference definitions], -the first is used: - -```````````````````````````````` example -[foo]: /url1 - -[foo]: /url2 - -[bar][foo] -. -

bar

-```````````````````````````````` - - -Note that matching is performed on normalized strings, not parsed -inline content. So the following does not match, even though the -labels define equivalent inline content: - -```````````````````````````````` example -[bar][foo\!] - -[foo!]: /url -. -

[bar][foo!]

-```````````````````````````````` - - -[Link labels] cannot contain brackets, unless they are -backslash-escaped: - -```````````````````````````````` example -[foo][ref[] - -[ref[]: /uri -. -

[foo][ref[]

-

[ref[]: /uri

-```````````````````````````````` - - -```````````````````````````````` example -[foo][ref[bar]] - -[ref[bar]]: /uri -. -

[foo][ref[bar]]

-

[ref[bar]]: /uri

-```````````````````````````````` - - -```````````````````````````````` example -[[[foo]]] - -[[[foo]]]: /url -. -

[[[foo]]]

-

[[[foo]]]: /url

-```````````````````````````````` - - -```````````````````````````````` example -[foo][ref\[] - -[ref\[]: /uri -. -

foo

-```````````````````````````````` - - -Note that in this example `]` is not backslash-escaped: - -```````````````````````````````` example -[bar\\]: /uri - -[bar\\] -. -

bar\

-```````````````````````````````` - - -A [link label] must contain at least one [non-whitespace character]: - -```````````````````````````````` example -[] - -[]: /uri -. -

[]

-

[]: /uri

-```````````````````````````````` - - -```````````````````````````````` example -[ - ] - -[ - ]: /uri -. -

[ -]

-

[ -]: /uri

-```````````````````````````````` - - -A [collapsed reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document, followed by the string `[]`. -The contents of the first link label are parsed as inlines, -which are used as the link's text. The link's URI and title are -provided by the matching reference link definition. Thus, -`[foo][]` is equivalent to `[foo][foo]`. - -```````````````````````````````` example -[foo][] - -[foo]: /url "title" -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar][] - -[*foo* bar]: /url "title" -. -

foo bar

-```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo][] - -[foo]: /url "title" -. -

Foo

-```````````````````````````````` - - - -As with full reference links, [whitespace] is not -allowed between the two sets of brackets: - -```````````````````````````````` example -[foo] -[] - -[foo]: /url "title" -. -

foo -[]

-```````````````````````````````` - - -A [shortcut reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document and is not followed by `[]` or a link label. -The contents of the first link label are parsed as inlines, -which are used as the link's text. The link's URI and title -are provided by the matching link reference definition. -Thus, `[foo]` is equivalent to `[foo][]`. - -```````````````````````````````` example -[foo] - -[foo]: /url "title" -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar] - -[*foo* bar]: /url "title" -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -[[*foo* bar]] - -[*foo* bar]: /url "title" -. -

[foo bar]

-```````````````````````````````` - - -```````````````````````````````` example -[[bar [foo] - -[foo]: /url -. -

[[bar foo

-```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo] - -[foo]: /url "title" -. -

Foo

-```````````````````````````````` - - -A space after the link text should be preserved: - -```````````````````````````````` example -[foo] bar - -[foo]: /url -. -

foo bar

-```````````````````````````````` - - -If you just want bracketed text, you can backslash-escape the -opening bracket to avoid links: - -```````````````````````````````` example -\[foo] - -[foo]: /url "title" -. -

[foo]

-```````````````````````````````` - - -Note that this is a link, because a link label ends with the first -following closing bracket: - -```````````````````````````````` example -[foo*]: /url - -*[foo*] -. -

*foo*

-```````````````````````````````` - - -Full and compact references take precedence over shortcut -references: - -```````````````````````````````` example -[foo][bar] - -[foo]: /url1 -[bar]: /url2 -. -

foo

-```````````````````````````````` - -```````````````````````````````` example -[foo][] - -[foo]: /url1 -. -

foo

-```````````````````````````````` - -Inline links also take precedence: - -```````````````````````````````` example -[foo]() - -[foo]: /url1 -. -

foo

-```````````````````````````````` - -```````````````````````````````` example -[foo](not a link) - -[foo]: /url1 -. -

foo(not a link)

-```````````````````````````````` - -In the following case `[bar][baz]` is parsed as a reference, -`[foo]` as normal text: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url -. -

[foo]bar

-```````````````````````````````` - - -Here, though, `[foo][bar]` is parsed as a reference, since -`[bar]` is defined: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[bar]: /url2 -. -

foobaz

-```````````````````````````````` - - -Here `[foo]` is not parsed as a shortcut reference, because it -is followed by a link label (even though `[bar]` is not defined): - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[foo]: /url2 -. -

[foo]bar

-```````````````````````````````` - - - -## Images - -Syntax for images is like the syntax for links, with one -difference. Instead of [link text], we have an -[image description](@). The rules for this are the -same as for [link text], except that (a) an -image description starts with `![` rather than `[`, and -(b) an image description may contain links. -An image description has inline elements -as its contents. When an image is rendered to HTML, -this is standardly used as the image's `alt` attribute. - -```````````````````````````````` example -![foo](/url "title") -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*] - -[foo *bar*]: train.jpg "train & tracks" -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -![foo ![bar](/url)](/url2) -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -![foo [bar](/url)](/url2) -. -

foo bar

-```````````````````````````````` - - -Though this spec is concerned with parsing, not rendering, it is -recommended that in rendering to HTML, only the plain string content -of the [image description] be used. Note that in -the above example, the alt attribute's value is `foo bar`, not `foo -[bar](/url)` or `foo bar`. Only the plain string -content is rendered, without formatting. - -```````````````````````````````` example -![foo *bar*][] - -[foo *bar*]: train.jpg "train & tracks" -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*][foobar] - -[FOOBAR]: train.jpg "train & tracks" -. -

foo bar

-```````````````````````````````` - - -```````````````````````````````` example -![foo](train.jpg) -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -My ![foo bar](/path/to/train.jpg "title" ) -. -

My foo bar

-```````````````````````````````` - - -```````````````````````````````` example -![foo]() -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -![](/url) -. -

-```````````````````````````````` - - -Reference-style: - -```````````````````````````````` example -![foo][bar] - -[bar]: /url -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -![foo][bar] - -[BAR]: /url -. -

foo

-```````````````````````````````` - - -Collapsed: - -```````````````````````````````` example -![foo][] - -[foo]: /url "title" -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar][] - -[*foo* bar]: /url "title" -. -

foo bar

-```````````````````````````````` - - -The labels are case-insensitive: - -```````````````````````````````` example -![Foo][] - -[foo]: /url "title" -. -

Foo

-```````````````````````````````` - - -As with reference links, [whitespace] is not allowed -between the two sets of brackets: - -```````````````````````````````` example -![foo] -[] - -[foo]: /url "title" -. -

foo -[]

-```````````````````````````````` - - -Shortcut: - -```````````````````````````````` example -![foo] - -[foo]: /url "title" -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar] - -[*foo* bar]: /url "title" -. -

foo bar

-```````````````````````````````` - - -Note that link labels cannot contain unescaped brackets: - -```````````````````````````````` example -![[foo]] - -[[foo]]: /url "title" -. -

![[foo]]

-

[[foo]]: /url "title"

-```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -![Foo] - -[foo]: /url "title" -. -

Foo

-```````````````````````````````` - - -If you just want a literal `!` followed by bracketed text, you can -backslash-escape the opening `[`: - -```````````````````````````````` example -!\[foo] - -[foo]: /url "title" -. -

![foo]

-```````````````````````````````` - - -If you want a link after a literal `!`, backslash-escape the -`!`: - -```````````````````````````````` example -\![foo] - -[foo]: /url "title" -. -

!foo

-```````````````````````````````` - - -## Autolinks - -[Autolink](@)s are absolute URIs and email addresses inside -`<` and `>`. They are parsed as links, with the URL or email address -as the link label. - -A [URI autolink](@) consists of `<`, followed by an -[absolute URI] not containing `<`, followed by `>`. It is parsed as -a link to the URI, with the URI as the link's label. - -An [absolute URI](@), -for these purposes, consists of a [scheme] followed by a colon (`:`) -followed by zero or more characters other than ASCII -[whitespace] and control characters, `<`, and `>`. If -the URI includes these characters, they must be percent-encoded -(e.g. `%20` for a space). - -For purposes of this spec, a [scheme](@) is any sequence -of 2--32 characters beginning with an ASCII letter and followed -by any combination of ASCII letters, digits, or the symbols plus -("+"), period ("."), or hyphen ("-"). - -Here are some valid autolinks: - -```````````````````````````````` example - -. -

http://foo.bar.baz

-```````````````````````````````` - - -```````````````````````````````` example - -. -

http://foo.bar.baz/test?q=hello&id=22&boolean

-```````````````````````````````` - - -```````````````````````````````` example - -. -

irc://foo.bar:2233/baz

-```````````````````````````````` - - -Uppercase is also fine: - -```````````````````````````````` example - -. -

MAILTO:FOO@BAR.BAZ

-```````````````````````````````` - - -Note that many strings that count as [absolute URIs] for -purposes of this spec are not valid URIs, because their -schemes are not registered or because of other problems -with their syntax: - -```````````````````````````````` example - -. -

a+b+c:d

-```````````````````````````````` - - -```````````````````````````````` example - -. -

made-up-scheme://foo,bar

-```````````````````````````````` - - -```````````````````````````````` example - -. -

http://../

-```````````````````````````````` - - -```````````````````````````````` example - -. -

localhost:5001/foo

-```````````````````````````````` - - -Spaces are not allowed in autolinks: - -```````````````````````````````` example - -. -

<http://foo.bar/baz bim>

-```````````````````````````````` - - -Backslash-escapes do not work inside autolinks: - -```````````````````````````````` example - -. -

http://example.com/\[\

-```````````````````````````````` - - -An [email autolink](@) -consists of `<`, followed by an [email address], -followed by `>`. The link's label is the email address, -and the URL is `mailto:` followed by the email address. - -An [email address](@), -for these purposes, is anything that matches -the [non-normative regex from the HTML5 -spec](https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)): - - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? - (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ - -Examples of email autolinks: - -```````````````````````````````` example - -. -

foo@bar.example.com

-```````````````````````````````` - - -```````````````````````````````` example - -. -

foo+special@Bar.baz-bar0.com

-```````````````````````````````` - - -Backslash-escapes do not work inside email autolinks: - -```````````````````````````````` example - -. -

<foo+@bar.example.com>

-```````````````````````````````` - - -These are not autolinks: - -```````````````````````````````` example -<> -. -

<>

-```````````````````````````````` - - -```````````````````````````````` example -< http://foo.bar > -. -

< http://foo.bar >

-```````````````````````````````` - - -```````````````````````````````` example - -. -

<m:abc>

-```````````````````````````````` - - -```````````````````````````````` example - -. -

<foo.bar.baz>

-```````````````````````````````` - - -```````````````````````````````` example -http://example.com -. -

http://example.com

-```````````````````````````````` - - -```````````````````````````````` example -foo@bar.example.com -. -

foo@bar.example.com

-```````````````````````````````` - - -## Raw HTML - -Text between `<` and `>` that looks like an HTML tag is parsed as a -raw HTML tag and will be rendered in HTML without escaping. -Tag and attribute names are not limited to current HTML tags, -so custom tags (and even, say, DocBook tags) may be used. - -Here is the grammar for tags: - -A [tag name](@) consists of an ASCII letter -followed by zero or more ASCII letters, digits, or -hyphens (`-`). - -An [attribute](@) consists of [whitespace], -an [attribute name], and an optional -[attribute value specification]. - -An [attribute name](@) -consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII -letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML -specification restricted to ASCII. HTML5 is laxer.) - -An [attribute value specification](@) -consists of optional [whitespace], -a `=` character, optional [whitespace], and an [attribute -value]. - -An [attribute value](@) -consists of an [unquoted attribute value], -a [single-quoted attribute value], or a [double-quoted attribute value]. - -An [unquoted attribute value](@) -is a nonempty string of characters not -including [whitespace], `"`, `'`, `=`, `<`, `>`, or `` ` ``. - -A [single-quoted attribute value](@) -consists of `'`, zero or more -characters not including `'`, and a final `'`. - -A [double-quoted attribute value](@) -consists of `"`, zero or more -characters not including `"`, and a final `"`. - -An [open tag](@) consists of a `<` character, a [tag name], -zero or more [attributes], optional [whitespace], an optional `/` -character, and a `>` character. - -A [closing tag](@) consists of the string ``. - -An [HTML comment](@) consists of ``, -where *text* does not start with `>` or `->`, does not end with `-`, -and does not contain `--`. (See the -[HTML5 spec](http://www.w3.org/TR/html5/syntax.html#comments).) - -A [processing instruction](@) -consists of the string ``, and the string -`?>`. - -A [declaration](@) consists of the -string ``, and the character `>`. - -A [CDATA section](@) consists of -the string ``, and the string `]]>`. - -An [HTML tag](@) consists of an [open tag], a [closing tag], -an [HTML comment], a [processing instruction], a [declaration], -or a [CDATA section]. - -Here are some simple open tags: - -```````````````````````````````` example - -. -

-```````````````````````````````` - - -Empty elements: - -```````````````````````````````` example - -. -

-```````````````````````````````` - - -[Whitespace] is allowed: - -```````````````````````````````` example - -. -

-```````````````````````````````` - - -With attributes: - -```````````````````````````````` example - -. -

-```````````````````````````````` - - -Custom tag names can be used: - -```````````````````````````````` example -Foo -. -

Foo

-```````````````````````````````` - - -Illegal tag names, not parsed as HTML: - -```````````````````````````````` example -<33> <__> -. -

<33> <__>

-```````````````````````````````` - - -Illegal attribute names: - -```````````````````````````````` example -
-. -

<a h*#ref="hi">

-```````````````````````````````` - - -Illegal attribute values: - -```````````````````````````````` example -
-. -

</a href="foo">

-```````````````````````````````` - - -Comments: - -```````````````````````````````` example -foo -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -foo -. -

foo <!-- not a comment -- two hyphens -->

-```````````````````````````````` - - -Not comments: - -```````````````````````````````` example -foo foo --> - -foo -. -

foo <!--> foo -->

-

foo <!-- foo--->

-```````````````````````````````` - - -Processing instructions: - -```````````````````````````````` example -foo -. -

foo

-```````````````````````````````` - - -Declarations: - -```````````````````````````````` example -foo -. -

foo

-```````````````````````````````` - - -CDATA sections: - -```````````````````````````````` example -foo &<]]> -. -

foo &<]]>

-```````````````````````````````` - - -Entity and numeric character references are preserved in HTML -attributes: - -```````````````````````````````` example -foo
-. -

foo

-```````````````````````````````` - - -Backslash escapes do not work in HTML attributes: - -```````````````````````````````` example -foo -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example - -. -

<a href=""">

-```````````````````````````````` - - -## Hard line breaks - -A line break (not in a code span or HTML tag) that is preceded -by two or more spaces and does not occur at the end of a block -is parsed as a [hard line break](@) (rendered -in HTML as a `
` tag): - -```````````````````````````````` example -foo -baz -. -

foo
-baz

-```````````````````````````````` - - -For a more visible alternative, a backslash before the -[line ending] may be used instead of two spaces: - -```````````````````````````````` example -foo\ -baz -. -

foo
-baz

-```````````````````````````````` - - -More than two spaces can be used: - -```````````````````````````````` example -foo -baz -. -

foo
-baz

-```````````````````````````````` - - -Leading spaces at the beginning of the next line are ignored: - -```````````````````````````````` example -foo - bar -. -

foo
-bar

-```````````````````````````````` - - -```````````````````````````````` example -foo\ - bar -. -

foo
-bar

-```````````````````````````````` - - -Line breaks can occur inside emphasis, links, and other constructs -that allow inline content: - -```````````````````````````````` example -*foo -bar* -. -

foo
-bar

-```````````````````````````````` - - -```````````````````````````````` example -*foo\ -bar* -. -

foo
-bar

-```````````````````````````````` - - -Line breaks do not occur inside code spans - -```````````````````````````````` example -`code -span` -. -

code span

-```````````````````````````````` - - -```````````````````````````````` example -`code\ -span` -. -

code\ span

-```````````````````````````````` - - -or HTML tags: - -```````````````````````````````` example -
-. -

-```````````````````````````````` - - -```````````````````````````````` example - -. -

-```````````````````````````````` - - -Hard line breaks are for separating inline content within a block. -Neither syntax for hard line breaks works at the end of a paragraph or -other block element: - -```````````````````````````````` example -foo\ -. -

foo\

-```````````````````````````````` - - -```````````````````````````````` example -foo -. -

foo

-```````````````````````````````` - - -```````````````````````````````` example -### foo\ -. -

foo\

-```````````````````````````````` - - -```````````````````````````````` example -### foo -. -

foo

-```````````````````````````````` - - -## Soft line breaks - -A regular line break (not in a code span or HTML tag) that is not -preceded by two or more spaces or a backslash is parsed as a -[softbreak](@). (A softbreak may be rendered in HTML either as a -[line ending] or as a space. The result will be the same in -browsers. In the examples here, a [line ending] will be used.) - -```````````````````````````````` example -foo -baz -. -

foo -baz

-```````````````````````````````` - - -Spaces at the end of the line and beginning of the next line are -removed: - -```````````````````````````````` example -foo - baz -. -

foo -baz

-```````````````````````````````` - - -A conforming parser may render a soft line break in HTML either as a -line break or as a space. - -A renderer may also provide an option to render soft line breaks -as hard line breaks. - -## Textual content - -Any characters not given an interpretation by the above rules will -be parsed as plain textual content. - -```````````````````````````````` example -hello $.;'there -. -

hello $.;'there

-```````````````````````````````` - - -```````````````````````````````` example -Foo χρῆν -. -

Foo χρῆν

-```````````````````````````````` - - -Internal spaces are preserved verbatim: - -```````````````````````````````` example -Multiple spaces -. -

Multiple spaces

-```````````````````````````````` - - - - -# Appendix: A parsing strategy - -In this appendix we describe some features of the parsing strategy -used in the CommonMark reference implementations. - -## Overview - -Parsing has two phases: - -1. In the first phase, lines of input are consumed and the block -structure of the document---its division into paragraphs, block quotes, -list items, and so on---is constructed. Text is assigned to these -blocks but not parsed. Link reference definitions are parsed and a -map of links is constructed. - -2. In the second phase, the raw text contents of paragraphs and headings -are parsed into sequences of Markdown inline elements (strings, -code spans, links, emphasis, and so on), using the map of link -references constructed in phase 1. - -At each point in processing, the document is represented as a tree of -**blocks**. The root of the tree is a `document` block. The `document` -may have any number of other blocks as **children**. These children -may, in turn, have other blocks as children. The last child of a block -is normally considered **open**, meaning that subsequent lines of input -can alter its contents. (Blocks that are not open are **closed**.) -Here, for example, is a possible document tree, with the open blocks -marked by arrows: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 1: block structure - -Each line that is processed has an effect on this tree. The line is -analyzed and, depending on its contents, the document may be altered -in one or more of the following ways: - -1. One or more open blocks may be closed. -2. One or more new blocks may be created as children of the - last open block. -3. Text may be added to the last (deepest) open block remaining - on the tree. - -Once a line has been incorporated into the tree in this way, -it can be discarded, so input can be read in a stream. - -For each line, we follow this procedure: - -1. First we iterate through the open blocks, starting with the -root document, and descending through last children down to the last -open block. Each block imposes a condition that the line must satisfy -if the block is to remain open. For example, a block quote requires a -`>` character. A paragraph requires a non-blank line. -In this phase we may match all or just some of the open -blocks. But we cannot close unmatched blocks yet, because we may have a -[lazy continuation line]. - -2. Next, after consuming the continuation markers for existing -blocks, we look for new block starts (e.g. `>` for a block quote). -If we encounter a new block start, we close any blocks unmatched -in step 1 before creating the new block as a child of the last -matched block. - -3. Finally, we look at the remainder of the line (after block -markers like `>`, list markers, and indentation have been consumed). -This is text that can be incorporated into the last open -block (a paragraph, code block, heading, or raw HTML). - -Setext headings are formed when we see a line of a paragraph -that is a [setext heading underline]. - -Reference link definitions are detected when a paragraph is closed; -the accumulated text lines are parsed to see if they begin with -one or more reference link definitions. Any remainder becomes a -normal paragraph. - -We can see how this works by considering how the tree above is -generated by four lines of Markdown: - -``` markdown -> Lorem ipsum dolor -sit amet. -> - Qui *quodsi iracundia* -> - aliquando id -``` - -At the outset, our document model is just - -``` tree --> document -``` - -The first line of our text, - -``` markdown -> Lorem ipsum dolor -``` - -causes a `block_quote` block to be created as a child of our -open `document` block, and a `paragraph` block as a child of -the `block_quote`. Then the text is added to the last open -block, the `paragraph`: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor" -``` - -The next line, - -``` markdown -sit amet. -``` - -is a "lazy continuation" of the open `paragraph`, so it gets added -to the paragraph's text: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor\nsit amet." -``` - -The third line, - -``` markdown -> - Qui *quodsi iracundia* -``` - -causes the `paragraph` block to be closed, and a new `list` block -opened as a child of the `block_quote`. A `list_item` is also -added as a child of the `list`, and a `paragraph` as a child of -the `list_item`. The text is then added to the new `paragraph`: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - -> list_item - -> paragraph - "Qui *quodsi iracundia*" -``` - -The fourth line, - -``` markdown -> - aliquando id -``` - -causes the `list_item` (and its child the `paragraph`) to be closed, -and a new `list_item` opened up as child of the `list`. A `paragraph` -is added as a child of the new `list_item`, to contain the text. -We thus obtain the final tree: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 2: inline structure - -Once all of the input has been parsed, all open blocks are closed. - -We then "walk the tree," visiting every node, and parse raw -string contents of paragraphs and headings as inlines. At this -point we have seen all the link reference definitions, so we can -resolve reference links as we go. - -``` tree -document - block_quote - paragraph - str "Lorem ipsum dolor" - softbreak - str "sit amet." - list (type=bullet tight=true bullet_char=-) - list_item - paragraph - str "Qui " - emph - str "quodsi iracundia" - list_item - paragraph - str "aliquando id" -``` - -Notice how the [line ending] in the first paragraph has -been parsed as a `softbreak`, and the asterisks in the first list item -have become an `emph`. - -### An algorithm for parsing nested emphasis and links - -By far the trickiest part of inline parsing is handling emphasis, -strong emphasis, links, and images. This is done using the following -algorithm. - -When we're parsing inlines and we hit either - -- a run of `*` or `_` characters, or -- a `[` or `![` - -we insert a text node with these symbols as its literal content, and we -add a pointer to this text node to the [delimiter stack](@). - -The [delimiter stack] is a doubly linked list. Each -element contains a pointer to a text node, plus information about - -- the type of delimiter (`[`, `![`, `*`, `_`) -- the number of delimiters, -- whether the delimiter is "active" (all are active to start), and -- whether the delimiter is a potential opener, a potential closer, - or both (which depends on what sort of characters precede - and follow the delimiters). - -When we hit a `]` character, we call the *look for link or image* -procedure (see below). - -When we hit the end of the input, we call the *process emphasis* -procedure (see below), with `stack_bottom` = NULL. - -#### *look for link or image* - -Starting at the top of the delimiter stack, we look backwards -through the stack for an opening `[` or `![` delimiter. - -- If we don't find one, we return a literal text node `]`. - -- If we do find one, but it's not *active*, we remove the inactive - delimiter from the stack, and return a literal text node `]`. - -- If we find one and it's active, then we parse ahead to see if - we have an inline link/image, reference link/image, compact reference - link/image, or shortcut reference link/image. - - + If we don't, then we remove the opening delimiter from the - delimiter stack and return a literal text node `]`. - - + If we do, then - - * We return a link or image node whose children are the inlines - after the text node pointed to by the opening delimiter. - - * We run *process emphasis* on these inlines, with the `[` opener - as `stack_bottom`. - - * We remove the opening delimiter. - - * If we have a link (and not an image), we also set all - `[` delimiters before the opening delimiter to *inactive*. (This - will prevent us from getting links within links.) - -#### *process emphasis* - -Parameter `stack_bottom` sets a lower bound to how far we -descend in the [delimiter stack]. If it is NULL, we can -go all the way to the bottom. Otherwise, we stop before -visiting `stack_bottom`. - -Let `current_position` point to the element on the [delimiter stack] -just above `stack_bottom` (or the first element if `stack_bottom` -is NULL). - -We keep track of the `openers_bottom` for each delimiter -type (`*`, `_`). Initialize this to `stack_bottom`. - -Then we repeat the following until we run out of potential -closers: - -- Move `current_position` forward in the delimiter stack (if needed) - until we find the first potential closer with delimiter `*` or `_`. - (This will be the potential closer closest - to the beginning of the input -- the first one in parse order.) - -- Now, look back in the stack (staying above `stack_bottom` and - the `openers_bottom` for this delimiter type) for the - first matching potential opener ("matching" means same delimiter). - -- If one is found: - - + Figure out whether we have emphasis or strong emphasis: - if both closer and opener spans have length >= 2, we have - strong, otherwise regular. - - + Insert an emph or strong emph node accordingly, after - the text node corresponding to the opener. - - + Remove any delimiters between the opener and closer from - the delimiter stack. - - + Remove 1 (for regular emph) or 2 (for strong emph) delimiters - from the opening and closing text nodes. If they become empty - as a result, remove them and remove the corresponding element - of the delimiter stack. If the closing node is removed, reset - `current_position` to the next element in the stack. - -- If none in found: - - + Set `openers_bottom` to the element before `current_position`. - (We know that there are no openers for this kind of closer up to and - including this point, so this puts a lower bound on future searches.) - - + If the closer at `current_position` is not a potential opener, - remove it from the delimiter stack (since we know it can't - be a closer either). - - + Advance `current_position` to the next element in the stack. - -After we're done, we remove all delimiters above `stack_bottom` from the -delimiter stack. - diff -Nru rust-pulldown-cmark-0.2.0/tools/mk_entities.py rust-pulldown-cmark-0.8.0/tools/mk_entities.py --- rust-pulldown-cmark-0.2.0/tools/mk_entities.py 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tools/mk_entities.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -# Copyright 2015 Google Inc. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# get https://html.spec.whatwg.org/multipage/entities.json -# Usage: python tools/mk_entities.py entities.json > src/entities.rs - -import json -import sys - -def main(args): - jsondata = json.loads(file(args[1]).read()) - entities = [entity[1:-1] for entity in jsondata.keys() if entity.endswith(';')] - entities.sort() - print """// Copyright 2015 Google Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -//! Expansions of HTML5 entities - -// Autogenerated by mk_entities.py - -const ENTITIES: [&'static str; %i] = [""" % len(entities) - for e in entities: - print " \"" + e + "\"," - print """ ]; - -const ENTITY_VALUES: [&'static str; %i] = [""" % len(entities) - for e in entities: - codepoints = jsondata['&' + e + ';']["codepoints"]; - s = ''.join(['\u{%04X}' % cp for cp in codepoints]) - print " \"" + s + "\"," - print """ ]; - -pub fn get_entity(name: &str) -> Option<&'static str> { - ENTITIES.binary_search(&name).ok().map(|i| ENTITY_VALUES[i]) -} -""" - -main(sys.argv) \ No newline at end of file diff -Nru rust-pulldown-cmark-0.2.0/tools/mk_puncttable.py rust-pulldown-cmark-0.8.0/tools/mk_puncttable.py --- rust-pulldown-cmark-0.2.0/tools/mk_puncttable.py 2018-11-02 18:25:25.000000000 +0000 +++ rust-pulldown-cmark-0.8.0/tools/mk_puncttable.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -# Copyright 2015 Google Inc. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# get ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt -# Usage: python tools/mk_puncttable.py UnicodeData.txt > src/puncttable.rs - -import sys - -def get_bits(high, punct): - b = 0 - for i in range(16): - if high * 16 + i in punct: - b |= 1 << i - return b - -def main(args): - ascii_punct = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" - ascii_set = set((ord(c) for c in ascii_punct)) - - punct = set() - for line in file(args[1]): - spl = line.split(';') - if spl[2] in ('Pc', 'Pd', 'Pe', 'Pf', 'Pi', 'Po', 'Ps'): - punct.add(int(spl[0], 16)) - pshift = list(set((cp // 16 for cp in punct if cp >= 128))) - pshift.sort() - bits = [get_bits(high, punct) for high in pshift] - print """// Copyright 2015 Google Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -//! CommonMark punctuation set based on spec and Unicode properties. - -// Autogenerated by mk_puncttable.py - -const PUNCT_MASKS_ASCII: [u16; 8] = [""" - for x in range(8): - y = get_bits(x, ascii_set) - print ' 0x%04x, // U+%04X...U+%04X' % (y, x * 16, x * 16 + 15) - print """ ]; - -const PUNCT_TAB: [u16; %i] = [""" % len(pshift) - for x in pshift: - print ' %d, // U+%04X...U+%04X' % (x, x * 16, x * 16 + 15) - print """ ]; - -const PUNCT_MASKS: [u16; %i] = [""" % len(pshift) - for i, y in enumerate(bits): - x = pshift[i] - print ' 0x%04x, // U+%04X...U+%04X' % (y, x * 16, x * 16 + 15) - print """ ]; - -pub fn is_ascii_punctuation(c: u8) -> bool { - c < 128 && (PUNCT_MASKS_ASCII[(c / 16) as usize] & (1 << (c & 15))) != 0 -} - -pub fn is_punctuation(c: char) -> bool { - let cp = c as u32; - if cp < 128 {return is_ascii_punctuation(cp as u8); } - if cp > 0x%04X { return false; } - let high = (cp / 16) as u16; - match PUNCT_TAB.binary_search(&high) { - Ok(index) => (PUNCT_MASKS[index] & (1 << (cp & 15))) != 0, - _ => false - } -} - -#[cfg(test)] -mod tests { - use super::{is_ascii_punctuation, is_punctuation}; - - #[test] - fn test_ascii() { - assert!(is_ascii_punctuation(b'!')); - assert!(is_ascii_punctuation(b'@')); - assert!(is_ascii_punctuation(b'~')); - assert!(!is_ascii_punctuation(b' ')); - assert!(!is_ascii_punctuation(b'0')); - assert!(!is_ascii_punctuation(b'A')); - assert!(!is_ascii_punctuation(0xA1)); - } - - #[test] - fn test_unicode() { - assert!(is_punctuation('~')); - assert!(!is_punctuation(' ')); - - assert!(is_punctuation('\u{00A1}')); - assert!(is_punctuation('\u{060C}')); - assert!(is_punctuation('\u{FF65}')); - assert!(is_punctuation('\u{1BC9F}')); - assert!(!is_punctuation('\u{1BCA0}')); - } -} -""" % max(punct) - -main(sys.argv)