File tree 2 files changed +46
-2
lines changed
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> {
242
242
results. push ( ' ' ) ;
243
243
new_info. before = " " ;
244
244
} else {
245
- new_info. before = & results[ results . len ( ) - 1 .. ] ;
245
+ new_info. before = & results;
246
246
}
247
247
}
248
248
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 } ;
2
2
use mdast_util_to_markdown:: {
3
3
to_markdown as to, to_markdown_with_options as to_md_with_opts, Options ,
4
4
} ;
@@ -47,4 +47,48 @@ fn emphasis() {
47
47
"_a_\n " ,
48
48
"should support an emphasis w/ underscores when `emphasis: \" _\" `"
49
49
) ;
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
+ ) ;
50
94
}
You can’t perform that action at this time.
0 commit comments