Skip to content

Commit 2cd3e65

Browse files
committed
Fix lists in MDX
Closes GH-11.
1 parent 74ec046 commit 2cd3e65

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/construct/mdx_expression_flow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ use crate::util::constant::TAB_SIZE;
4949
pub fn start(tokenizer: &mut Tokenizer) -> State {
5050
if tokenizer.parse_state.options.constructs.mdx_expression_flow {
5151
tokenizer.tokenize_state.token_1 = Name::MdxFlowExpression;
52-
tokenizer.concrete = true;
5352
if matches!(tokenizer.current, Some(b'\t' | b' ')) {
5453
tokenizer.attempt(State::Next(StateName::MdxExpressionFlowBefore), State::Nok);
5554
State::Retry(space_or_tab_min_max(
@@ -77,6 +76,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State {
7776
/// ```
7877
pub fn before(tokenizer: &mut Tokenizer) -> State {
7978
if Some(b'{') == tokenizer.current {
79+
tokenizer.concrete = true;
8080
tokenizer.attempt(State::Next(StateName::MdxExpressionFlowAfter), State::Nok);
8181
State::Retry(StateName::MdxExpressionStart)
8282
} else {

tests/mdx_expression_flow.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ fn mdx_expression_flow_agnostic() -> Result<(), String> {
9595
"should support expressions preceded by spaces"
9696
);
9797

98+
assert_eq!(
99+
to_html_with_options("a\n\n* b", &mdx)?,
100+
"<p>a</p>\n<ul>\n<li>b</li>\n</ul>",
101+
"should support lists after non-expressions (GH-11)"
102+
);
103+
98104
assert_eq!(
99105
to_html_with_options("> {a\nb}", &mdx)
100106
.err()

0 commit comments

Comments
 (0)