Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #129 from monaqa/fix-string_spaces
Browse files Browse the repository at this point in the history
fix: Str literal in code/math mode to be preserved
  • Loading branch information
astrale-sharp authored Nov 25, 2023
2 parents 6ab2cab + 55f6068 commit 0c873d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fn visit(node: &LinkedNode, ctx: &mut Ctx) -> String {
}
Equation => math::format_equation(node, &res, ctx),
Math => math::format_math(node, &res, ctx),
Str => no_format(node, &res, ctx),
_ => format_default(node, &res, ctx),
};
if node.children().count() == 0 {
Expand Down
2 changes: 2 additions & 0 deletions lib/src/tests/snippets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ make_test!(official, OFFICIAL);
make_test!(raw_text, RAW);
make_test!(tabs, TABS);
make_test!(on_off, ON_OFF);
test_eq!(string_literal_in_math_mode, r#"$ a " x" $"#);
test_eq!(string_literal_in_code_mode, r#"#raw(" foo ");"#);
test_eq!(
line_wrap_off,
"a very very very very very very very very very very very very very long line",
Expand Down

0 comments on commit 0c873d3

Please sign in to comment.