Markdown parser fork with extended syntax for personal use.

Remove unneeded `extern crate`s

Closes GH-28.

Co-authored-by: Bernhard Berger <bernhardberger3456@gmail.com>

authored by

Hocdoc
Bernhard Berger
and committed by
GitHub
d5ae7bb1 34ea2841

+3 -100
-1
Untitled.txt
··· 6 6 ```rs 7 7 // --------------------- 8 8 // Useful helper: 9 - extern crate std; 10 9 use std::println; 11 10 use alloc::string::String; 12 11
+1 -3
benches/bench.rs
··· 1 - #[macro_use] 2 - extern crate criterion; 3 - use criterion::{BenchmarkId, Criterion}; 1 + use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; 4 2 use std::fs; 5 3 6 4 fn readme(c: &mut Criterion) {
-2
build.rs
··· 1 - extern crate reqwest; 2 1 use regex::Regex; 3 2 use std::fs; 4 3 ··· 67 66 // > 👉 **Important**: this module is generated by `build.rs`. 68 67 // > It is generate from the latest CommonMark website. 69 68 70 - extern crate markdown; 71 69 use markdown::{{to_html_with_options, CompileOptions, Options}}; 72 70 use pretty_assertions::assert_eq; 73 71
-2
examples/lib.rs
··· 1 - extern crate markdown; 2 - 3 1 fn main() -> Result<(), String> { 4 2 // Turn on debugging. 5 3 // You can show it with `RUST_LOG=debug cargo run --example lib`
+1 -5
fuzz/fuzz_targets/markdown.rs
··· 1 1 #![no_main] 2 2 use libfuzzer_sys::fuzz_target; 3 - extern crate markdown; 4 3 5 4 fuzz_target!(|data: &[u8]| { 6 5 if let Ok(s) = std::str::from_utf8(data) { 7 6 let _ = markdown::to_html(s); 8 - let _ = markdown::to_html_with_options( 9 - s, 10 - &markdown::Options::gfm() 11 - ); 7 + let _ = markdown::to_html_with_options(s, &markdown::Options::gfm()); 12 8 let _ = markdown::to_mdast(s, &markdown::ParseOptions::default()); 13 9 let _ = markdown::to_mdast(s, &markdown::ParseOptions::gfm()); 14 10 }
-6
readme.md
··· 90 90 ## Use 91 91 92 92 ```rs 93 - extern crate markdown; 94 - 95 93 fn main() { 96 94 println!("{}", markdown::to_html("## Hello, *world*!")); 97 95 } ··· 106 104 Extensions (in this case GFM): 107 105 108 106 ```rs 109 - extern crate markdown; 110 - 111 107 fn main() -> Result<(), String> { 112 108 println!( 113 109 "{}", ··· 136 132 Syntax tree ([mdast][]): 137 133 138 134 ```rs 139 - extern crate markdown; 140 - 141 135 fn main() -> Result<(), String> { 142 136 println!( 143 137 "{:?}",
-1
src/configuration.rs
··· 1236 1236 1237 1237 #[cfg(test)] 1238 1238 mod tests { 1239 - extern crate std; 1240 1239 use super::*; 1241 1240 use crate::util::mdx::Signal; 1242 1241 use alloc::format;
-3
src/util/line_ending.rs
··· 1 - extern crate alloc; 2 - 3 1 use alloc::{str::FromStr, string::String}; 4 2 5 3 /// Type of line endings in markdown. ··· 82 80 83 81 #[cfg(test)] 84 82 mod tests { 85 - extern crate std; 86 83 use super::*; 87 84 88 85 #[test]
-3
src/util/mdx.rs
··· 1 - extern crate alloc; 2 - 3 1 use alloc::string::String; 4 2 5 3 /// Signal used as feedback when parsing MDX ESM/expressions. ··· 89 87 90 88 #[cfg(test)] 91 89 mod tests { 92 - extern crate std; 93 90 use super::*; 94 91 use alloc::boxed::Box; 95 92
-1
tests/attention.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Emphasis, Node, Paragraph, Root, Strong, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/autolink.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Link, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/block_quote.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{BlockQuote, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/character_escape.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/character_reference.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/code_fenced.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Code, Node, Root}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/code_indented.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Code, Node, Root}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/code_text.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{InlineCode, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/commonmark.rs
··· 3 3 // > 👉 **Important**: this module is generated by `build.rs`. 4 4 // > It is generate from the latest CommonMark website. 5 5 6 - extern crate markdown; 7 6 use markdown::{to_html_with_options, CompileOptions, Options}; 8 7 use pretty_assertions::assert_eq; 9 8
-1
tests/definition.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Definition, Node, Root}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/frontmatter.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Node, Root, Toml, Yaml}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/fuzz.rs
··· 1 - extern crate markdown; 2 1 use markdown::{mdast, to_html, to_html_with_options, to_mdast, Options}; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/gfm_footnote.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{FootnoteDefinition, FootnoteReference, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/gfm_strikethrough.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Delete, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/gfm_table.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{AlignKind, InlineCode, Node, Root, Table, TableCell, TableRow, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/gfm_tagfilter.rs
··· 1 - extern crate markdown; 2 1 use markdown::{to_html_with_options, CompileOptions, Options}; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/gfm_task_list_item.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{List, ListItem, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/hard_break_escape.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Break, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/hard_break_trailing.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Break, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/heading_atx.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Heading, Node, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/heading_setext.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Heading, Node, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/html_flow.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Html, Node, Root}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/html_text.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Html, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/image.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Definition, Image, ImageReference, Node, Paragraph, ReferenceKind, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/list.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{List, ListItem, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/math_flow.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Math, Node, Root}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/math_text.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{InlineMath, Node, Paragraph, Root, Text}, 4 3 to_html, to_html_with_options, to_mdast,
-1
tests/mdx_esm.rs
··· 1 - extern crate markdown; 2 1 mod test_utils; 3 2 use markdown::{ 4 3 mdast::{MdxjsEsm, Node, Root},
-1
tests/mdx_expression_flow.rs
··· 1 - extern crate markdown; 2 1 mod test_utils; 3 2 use markdown::{ 4 3 mdast::{MdxFlowExpression, Node, Root},
-1
tests/mdx_expression_text.rs
··· 1 - extern crate markdown; 2 1 mod test_utils; 3 2 use markdown::{ 4 3 mdast::{MdxTextExpression, Node, Paragraph, Root, Text},
-1
tests/mdx_jsx_flow.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{List, ListItem, MdxJsxFlowElement, Node, Paragraph, Root, Text}, 4 3 to_html_with_options, to_mdast,
-1
tests/mdx_jsx_text.rs
··· 1 - extern crate markdown; 2 1 mod test_utils; 3 2 use markdown::{ 4 3 mdast::{
-1
tests/mdx_swc.rs
··· 1 - extern crate markdown; 2 1 mod test_utils; 3 2 use markdown::{to_html_with_options, Constructs, Options, ParseOptions}; 4 3 use pretty_assertions::assert_eq;
-1
tests/misc_bom.rs
··· 1 - extern crate markdown; 2 1 use markdown::to_html; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_dangerous_html.rs
··· 1 - extern crate markdown; 2 1 use markdown::{to_html, to_html_with_options, CompileOptions, Options}; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_dangerous_protocol.rs
··· 1 - extern crate markdown; 2 1 use markdown::to_html; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_default_line_ending.rs
··· 1 - extern crate markdown; 2 1 use markdown::{to_html, to_html_with_options, CompileOptions, LineEnding, Options}; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_line_ending.rs
··· 1 - extern crate markdown; 2 1 use markdown::{to_html, to_html_with_options, CompileOptions, Options}; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_soft_break.rs
··· 1 - extern crate markdown; 2 1 use markdown::to_html; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_tabs.rs
··· 1 - extern crate markdown; 2 1 use markdown::{to_html, to_html_with_options, CompileOptions, Options}; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_url.rs
··· 1 - extern crate markdown; 2 1 use markdown::to_html; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/misc_zero.rs
··· 1 - extern crate markdown; 2 1 use markdown::to_html; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/test_utils/hast.rs
··· 6 6 // ^-- To do: externalize. 7 7 8 8 extern crate alloc; 9 - extern crate markdown; 10 9 use alloc::{ 11 10 fmt, 12 11 string::{String, ToString},
-2
tests/test_utils/hast_util_to_swc.rs
··· 26 26 //! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 27 //! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 28 29 - extern crate swc_common; 30 - extern crate swc_ecma_ast; 31 29 use crate::test_utils::{ 32 30 hast, 33 31 swc::{parse_esm_to_tree, parse_expression_to_tree},
-1
tests/test_utils/mdx_plugin_recma_document.rs
··· 3 3 //! Port of <https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/recma-document.js>, 4 4 //! by the same author. 5 5 6 - extern crate swc_ecma_ast; 7 6 use crate::test_utils::{ 8 7 hast_util_to_swc::Program, 9 8 swc_utils::{bytepos_to_point, prefix_error_with_point, span_to_position},
-2
tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs
··· 3 3 //! Port of <https://github.com/mdx-js/mdx/blob/main/packages/mdx/lib/plugin/recma-jsx-rewrite.js>, 4 4 //! by the same author. 5 5 6 - extern crate swc_common; 7 - extern crate swc_ecma_ast; 8 6 use crate::test_utils::{ 9 7 hast_util_to_swc::Program, 10 8 swc_utils::{
+1 -4
tests/test_utils/swc.rs
··· 1 1 //! Bridge between `markdown-rs` and SWC. 2 - extern crate markdown; 3 - extern crate swc_common; 4 - extern crate swc_ecma_ast; 5 - extern crate swc_ecma_parser; 2 + 6 3 use crate::test_utils::swc_utils::{bytepos_to_point, prefix_error_with_point, RewriteContext}; 7 4 use markdown::{mdast::Stop, unist::Point, Location, MdxExpressionKind, MdxSignal}; 8 5 use swc_common::{
-1
tests/text.rs
··· 1 - extern crate markdown; 2 1 use markdown::to_html; 3 2 use pretty_assertions::assert_eq; 4 3
-1
tests/thematic_break.rs
··· 1 - extern crate markdown; 2 1 use markdown::{ 3 2 mdast::{Node, Root, ThematicBreak}, 4 3 to_html, to_html_with_options, to_mdast,
-4
tests/xxx_hast_util_to_swc.rs
··· 1 - extern crate markdown; 2 - extern crate swc_common; 3 - extern crate swc_ecma_ast; 4 - extern crate swc_ecma_codegen; 5 1 mod test_utils; 6 2 use pretty_assertions::assert_eq; 7 3 use test_utils::{
-1
tests/xxx_mdast_util_to_hast.rs
··· 1 - extern crate markdown; 2 1 mod test_utils; 3 2 use markdown::mdast; 4 3 use pretty_assertions::assert_eq;
-4
tests/xxx_mdx.rs
··· 1 - extern crate markdown; 2 - extern crate swc_common; 3 - extern crate swc_ecma_ast; 4 - extern crate swc_ecma_codegen; 5 1 mod test_utils; 6 2 use pretty_assertions::assert_eq; 7 3 use test_utils::mdx::{mdx, JsxRuntime, Options};
-4
tests/xxx_mdx_plugin_recma_document.rs
··· 1 - extern crate markdown; 2 - extern crate swc_common; 3 - extern crate swc_ecma_ast; 4 - extern crate swc_ecma_codegen; 5 1 mod test_utils; 6 2 use markdown::{to_mdast, Location, ParseOptions}; 7 3 use pretty_assertions::assert_eq;
-4
tests/xxx_mdx_plugin_recma_jsx_rewrite.rs
··· 1 - extern crate markdown; 2 - extern crate swc_common; 3 - extern crate swc_ecma_ast; 4 - extern crate swc_ecma_codegen; 5 1 mod test_utils; 6 2 use markdown::{to_mdast, Location, ParseOptions}; 7 3 use pretty_assertions::assert_eq;