@@ -52,25 +52,25 @@ impl ParagraphSpan {
5252 let mut terms: Vec < ParagraphKind > = Vec :: with_capacity ( self . terms . len ( ) ) ;
5353 for term in & self . terms {
5454 match term {
55- ParagraphTerm :: Text ( v) => terms. push ( v . as_ref ( ) . clone ( ) . into ( ) ) ,
55+ ParagraphTerm :: Text ( v) => terms. push ( ParagraphKind :: Plain ( v . clone ( ) ) ) ,
5656 ParagraphTerm :: WhiteSpace ( v) => {
5757 terms. push ( ParagraphKind :: Space ( v. clone ( ) ) ) ;
5858 }
5959 ParagraphTerm :: Italic ( v) => {
60- terms. push ( v. as_hir ( ) . into ( ) ) ;
60+ terms. push ( ParagraphKind :: Style ( Box :: new ( v. as_hir ( ) ) ) ) ;
6161 }
6262 ParagraphTerm :: Bold ( v) => {
63- terms. push ( v. as_hir ( ) . into ( ) ) ;
63+ terms. push ( ParagraphKind :: Style ( Box :: new ( v. as_hir ( ) ) ) ) ;
6464 }
65- ParagraphTerm :: BoldItalic ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
65+ ParagraphTerm :: BoldItalic ( v) => terms. push ( ParagraphKind :: Style ( Box :: new ( v. as_hir ( ) ) ) ) ,
6666 ParagraphTerm :: NewLine ( v) => {
67- terms. push ( v. as_hir ( ) . into ( ) ) ;
67+ terms. push ( ParagraphKind :: Space ( Box :: new ( v. as_hir ( ) ) ) ) ;
6868 }
6969 ParagraphTerm :: Comma ( v) => {
70- terms. push ( v. as_hir ( ) . into ( ) ) ;
70+ terms. push ( ParagraphKind :: Plain ( Box :: new ( v. as_hir ( ) ) ) ) ;
7171 }
7272 ParagraphTerm :: Period ( v) => {
73- terms. push ( v. as_hir ( ) . into ( ) ) ;
73+ terms. push ( ParagraphKind :: Plain ( Box :: new ( v. as_hir ( ) ) ) ) ;
7474 }
7575 ParagraphTerm :: Escape ( v) => {
7676 match v. escape {
@@ -82,13 +82,13 @@ impl ParagraphSpan {
8282 }
8383 // terms.push(v.as_hir().into());
8484 }
85- ParagraphTerm :: Underline ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
86- ParagraphTerm :: Delete ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
87- ParagraphTerm :: Code ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
88- ParagraphTerm :: CommandLine ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
85+ ParagraphTerm :: Underline ( v) => terms. push ( ParagraphKind :: Style ( Box :: new ( v. as_hir ( ) ) ) ) ,
86+ ParagraphTerm :: Delete ( v) => terms. push ( ParagraphKind :: Style ( Box :: new ( v. as_hir ( ) ) ) ) ,
87+ ParagraphTerm :: Code ( v) => terms. push ( ParagraphKind :: Code ( Box :: new ( v. as_hir ( ) ) ) ) ,
88+ ParagraphTerm :: CommandLine ( v) => terms. push ( ParagraphKind :: Command ( Box :: new ( v. as_hir ( ) ) ) ) ,
8989 ParagraphTerm :: Uri ( v) => terms. push ( ParagraphKind :: Uri ( v. clone ( ) ) ) ,
90- ParagraphTerm :: DisplayMath ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
91- ParagraphTerm :: InlineMath ( v) => terms. push ( v. as_hir ( ) . into ( ) ) ,
90+ ParagraphTerm :: DisplayMath ( v) => terms. push ( ParagraphKind :: Code ( Box :: new ( v. as_hir ( ) ) ) ) ,
91+ ParagraphTerm :: InlineMath ( v) => terms. push ( ParagraphKind :: Code ( Box :: new ( v. as_hir ( ) ) ) ) ,
9292 }
9393 }
9494 ParagraphNode { terms, span : self . span . clone ( ) }
0 commit comments