File tree Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ impl<'a> State<'a> {
242242 results. push ( ' ' ) ;
243243 new_info. before = " " ;
244244 } else {
245- new_info. before = & results[ results . len ( ) - 1 .. ] ;
245+ new_info. before = & results;
246246 }
247247 }
248248
Original file line number Diff line number Diff line change 1- use markdown:: mdast:: { Emphasis , Node , Text } ;
1+ use markdown:: mdast:: { Emphasis , Node , Paragraph , Text } ;
22use mdast_util_to_markdown:: {
33 to_markdown as to, to_markdown_with_options as to_md_with_opts, Options ,
44} ;
@@ -47,4 +47,48 @@ fn emphasis() {
4747 "_a_\n " ,
4848 "should support an emphasis w/ underscores when `emphasis: \" _\" `"
4949 ) ;
50+
51+ assert_eq ! (
52+ to( & Node :: Paragraph ( Paragraph {
53+ children: vec![
54+ Node :: Text ( Text {
55+ value: String :: from( "𝄞" ) ,
56+ position: None
57+ } ) ,
58+ Node :: Emphasis ( Emphasis {
59+ children: vec![ Node :: Text ( Text {
60+ value: String :: from( "a" ) ,
61+ position: None ,
62+ } ) ] ,
63+ position: None
64+ } )
65+ ] ,
66+ position: None
67+ } ) )
68+ . unwrap( ) ,
69+ "𝄞*a*\n " ,
70+ "should support non-ascii before emphasis"
71+ ) ;
72+
73+ assert_eq ! (
74+ to( & Node :: Paragraph ( Paragraph {
75+ children: vec![
76+ Node :: Emphasis ( Emphasis {
77+ children: vec![ Node :: Text ( Text {
78+ value: String :: from( "a" ) ,
79+ position: None ,
80+ } ) ] ,
81+ position: None
82+ } ) ,
83+ Node :: Text ( Text {
84+ value: String :: from( "𝄞" ) ,
85+ position: None
86+ } ) ,
87+ ] ,
88+ position: None
89+ } ) )
90+ . unwrap( ) ,
91+ "*a*𝄞\n " ,
92+ "should support non-ascii after emphasis"
93+ ) ;
5094}
You can’t perform that action at this time.
0 commit comments