Skip to content

Commit

Permalink
chore(infra): typos (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter authored Jul 2, 2024
1 parent 18ad02b commit b2eb21b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

### Bug Fixes

* anchor missed when link exsited in header ([6504df2](https://github.com/web-infra-dev/mdx-rs/commit/6504df27555565aba8262326d5947b3427915fb2))
* anchor missed when link existed in header ([6504df2](https://github.com/web-infra-dev/mdx-rs/commit/6504df27555565aba8262326d5947b3427915fb2))



Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @rspress/mdx-rs

This is a Node.js binding for MDX compliation of [Rspress](https://rspress.dev) which is a modern documentation tool based on [Rspack](https://www.rspack.org/).
This is a Node.js binding for MDX compilation of [Rspress](https://rspress.dev) which is a modern documentation tool based on [Rspack](https://www.rspack.org/).

It can be 10x+ faster than compiler in pure JavaScript version.The [benchmark](./benches/index.mjs) result of `@rspress/mdx-rs` vs `@mdx-js/mdx` is as follows:

Expand Down
2 changes: 1 addition & 1 deletion crates/mdx_rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn compile(
let parse_options = ParseOptions {
constructs: Constructs {
frontmatter: true,
// Enable GFM Grammer
// Enable GFM Grammar
gfm_autolink_literal: true,
gfm_label_start_footnote: true,
gfm_footnote_definition: true,
Expand Down
2 changes: 1 addition & 1 deletion crates/mdx_rs/src/mdx_plugin_recma_jsx_rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ fn create_error_helper(development: bool, path: Option<String>) -> ModuleItem {
},
];

// Accept a source location (which might be undefiend).
// Accept a source location (which might be undefined).
if development {
parameters.push(Param {
pat: Pat::Ident(BindingIdent {
Expand Down
2 changes: 1 addition & 1 deletion crates/mdx_rs/src/swc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ fn swc_error_to_string(error: &SwcError) -> String {
///
/// This is needed because for expressions, we use an API that parses up to
/// a valid expression, but there may be more expressions after it, which we
/// don’t alow.
/// don’t allow.
fn whitespace_and_comments(mut index: usize, value: &str) -> Result<(), (Span, String)> {
let bytes = value.as_bytes();
let len = bytes.len();
Expand Down
2 changes: 1 addition & 1 deletion crates/plugin_container/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn parse_title_from_meta(title_meta: &str) -> String {
let mut title = title_meta;
let quote = title_meta.chars().nth(6).unwrap();
if quote != '"' && quote != '\'' {
// ignore the last char, bacause it is "}"
// ignore the last char, because it is "}"
let last_index = title.rfind("}").unwrap_or(title.len());
title = &title[6..last_index];
} else {
Expand Down
8 changes: 4 additions & 4 deletions crates/plugin_normalize_link/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use hast;
use std::path::Path;

const PROTOCOLS: &[&str] = &["http://", "https://", "mailto:", "tel:", "javascript:", "#"];
const TEMP_VARIBLE: &str = "image_";
const TEMP_VARIABLE: &str = "image_";
const IMAGE_EXTNAMES: &[&str] = &[".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp"];
const MD_EXTNAMES: &[&str] = &[".md", ".mdx"];

Expand All @@ -19,7 +19,7 @@ fn generate_ast_import(
hast::MdxjsEsm {
value: format!(
"import {} from \"{}\";",
format!("{}{}", TEMP_VARIBLE, index),
format!("{}{}", TEMP_VARIABLE, index),
import_path
),
position: None,
Expand Down Expand Up @@ -156,7 +156,7 @@ fn mdx_plugin_normalize_link_impl(
name: "src".to_string(),
value: Some(hast::AttributeValue::Expression(
markdown::mdast::AttributeValueExpression {
value: format!("{}{}", TEMP_VARIBLE, index),
value: format!("{}{}", TEMP_VARIABLE, index),
stops: vec![],
},
)),
Expand Down Expand Up @@ -210,7 +210,7 @@ fn mdx_plugin_normalize_link_impl(
images.push(generate_ast_import(index, root, value, filepath));
property.value = Some(hast::AttributeValue::Expression(
markdown::mdast::AttributeValueExpression {
value: format!("{}{}", TEMP_VARIBLE, index),
value: format!("{}{}", TEMP_VARIABLE, index),
stops: vec![],
},
));
Expand Down

0 comments on commit b2eb21b

Please sign in to comment.