aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/mdx_jsx_text.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-09 10:18:24 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-09 10:18:24 +0200
commit71dbc8c0189d6b2032f3d8f21cbfffa3f8fe0f12 (patch)
treea951ca69256849a49cc2a3fa8bc77f0ff75d5784 /src/construct/mdx_jsx_text.rs
parentd1392983e44870a7fa50eaf77da4a5741011f5c7 (diff)
downloadmarkdown-rs-71dbc8c0189d6b2032f3d8f21cbfffa3f8fe0f12.tar.gz
markdown-rs-71dbc8c0189d6b2032f3d8f21cbfffa3f8fe0f12.tar.bz2
markdown-rs-71dbc8c0189d6b2032f3d8f21cbfffa3f8fe0f12.zip
Add docs to mdx jsx
Diffstat (limited to 'src/construct/mdx_jsx_text.rs')
-rw-r--r--src/construct/mdx_jsx_text.rs46
1 files changed, 43 insertions, 3 deletions
diff --git a/src/construct/mdx_jsx_text.rs b/src/construct/mdx_jsx_text.rs
index f4cab4e..782e215 100644
--- a/src/construct/mdx_jsx_text.rs
+++ b/src/construct/mdx_jsx_text.rs
@@ -1,4 +1,34 @@
-//! To do.
+//! MDX JSX (text) occurs in the [text][] content type.
+//!
+//! ## Grammar
+//!
+//! MDX JSX (text) forms with the following BNF
+//! (<small>see [construct][crate::construct] for character groups</small>):
+//!
+//! ```bnf
+//! mdx_jsx_text ::= mdx_jsx
+//!
+//! ; See the `partial_mdx_jsx` construct for the BNF of that part.
+//! ```
+//!
+//! See [`mdx_jsx`][mdx_jsx] for more info.
+//!
+//! ## Tokens
+//!
+//! * [`MdxJsxTextTag`][Name::MdxJsxTextTag]
+//! * see [`mdx_jsx`][mdx_jsx] for more
+//!
+//! ## Recommendation
+//!
+//! See [`mdx_jsx`][mdx_jsx] for recommendations.
+//!
+//! ## References
+//!
+//! * [`jsx-text.js` in `micromark-extension-mdx-jsx`](https://github.com/micromark/micromark-extension-mdx-jsx/blob/main/dev/lib/jsx-text.js)
+//! * [`mdxjs.com`](https://mdxjs.com)
+//!
+//! [text]: crate::construct::text
+//! [mdx_jsx]: crate::construct::partial_mdx_jsx
use crate::event::Name;
use crate::state::{Name as StateName, State};
@@ -23,13 +53,23 @@ pub fn start(tokenizer: &mut Tokenizer) -> State {
}
}
-/// To do
+/// After an MDX JSX (text) tag.
+///
+/// ```markdown
+/// > | a <b> c
+/// ^
+/// ```
pub fn after(tokenizer: &mut Tokenizer) -> State {
tokenizer.tokenize_state.token_1 = Name::Data;
State::Ok
}
-/// To do
+/// At something that wasn’t an MDX JSX (text) tag.
+///
+/// ```markdown
+/// > | a < b
+/// ^
+/// ```
pub fn nok(tokenizer: &mut Tokenizer) -> State {
tokenizer.tokenize_state.token_1 = Name::Data;
State::Nok