1- use crate :: {
2- InlineNode , Location , Plain , ProcessedContent ,
3- } ;
1+ use crate :: { InlineNode , Location , Plain , ProcessedContent } ;
42
53use super :: document:: ParserState ;
64
@@ -19,11 +17,8 @@ pub(crate) fn map_bold_text_locations(
1917) -> crate :: Bold {
2018 // Map outer location with attribute extension
2119 let mapped_outer = map_loc ( & bold_text. location ) ;
22- let extended_location = extend_attribute_location_if_needed (
23- mapping_ctx. state ,
24- mapping_ctx. processed ,
25- mapped_outer
26- ) ;
20+ let extended_location =
21+ extend_attribute_location_if_needed ( mapping_ctx. state , mapping_ctx. processed , mapped_outer) ;
2722 bold_text. location = extended_location;
2823
2924 // Map inner content locations
@@ -47,11 +42,8 @@ pub(crate) fn map_italic_text_locations(
4742) -> crate :: Italic {
4843 // Map outer location with attribute extension
4944 let mapped_outer = map_loc ( & italic_text. location ) ;
50- let extended_location = extend_attribute_location_if_needed (
51- mapping_ctx. state ,
52- mapping_ctx. processed ,
53- mapped_outer
54- ) ;
45+ let extended_location =
46+ extend_attribute_location_if_needed ( mapping_ctx. state , mapping_ctx. processed , mapped_outer) ;
5547 italic_text. location = extended_location;
5648
5749 // Map inner content locations
@@ -192,7 +184,10 @@ pub(crate) fn map_inner_content_locations(
192184 . map ( |node| match node {
193185 InlineNode :: PlainText ( mut inner_plain) => {
194186 // Replace passthrough placeholders in the content
195- let content = super :: passthrough_processing:: replace_passthrough_placeholders ( & inner_plain. content , processed) ;
187+ let content = super :: passthrough_processing:: replace_passthrough_placeholders (
188+ & inner_plain. content ,
189+ processed,
190+ ) ;
196191 inner_plain. content = content;
197192
198193 // Map to document coordinates first (use normal location mapping for inner content)
@@ -209,11 +204,7 @@ pub(crate) fn map_inner_content_locations(
209204 processed,
210205 base_location,
211206 } ;
212- let mapped = map_italic_text_locations (
213- italic_text,
214- map_loc,
215- & mapping_ctx,
216- ) ;
207+ let mapped = map_italic_text_locations ( italic_text, map_loc, & mapping_ctx) ;
217208 InlineNode :: ItalicText ( mapped)
218209 }
219210 InlineNode :: BoldText ( bold_text) => {
@@ -223,19 +214,14 @@ pub(crate) fn map_inner_content_locations(
223214 processed,
224215 base_location,
225216 } ;
226- let mapped = map_bold_text_locations (
227- bold_text,
228- map_loc,
229- & mapping_ctx,
230- ) ;
217+ let mapped = map_bold_text_locations ( bold_text, map_loc, & mapping_ctx) ;
231218 InlineNode :: BoldText ( mapped)
232219 }
233220 other => other,
234221 } )
235222 . collect ( )
236223}
237224
238-
239225/// Remap the location of an inline node to final document coordinates
240226pub ( crate ) fn remap_inline_node_location ( node : & mut InlineNode , base_offset : usize ) {
241227 match node {
@@ -443,4 +429,4 @@ pub(crate) fn map_inline_locations(
443429 other => vec ! [ other. clone( ) ] ,
444430 } )
445431 . collect :: < Vec < _ > > ( )
446- }
432+ }
0 commit comments