@@ -542,57 +542,6 @@ fn as_smart_str(s: String) -> String {
542542 }
543543}
544544
545- /// Re-split Cite content strings after merge_strs to match Pandoc's behavior
546- /// Pandoc breaks up citation suffix text by spaces
547- pub fn split_cite_content_strings ( pandoc : Pandoc ) -> Pandoc {
548- topdown_traverse (
549- pandoc,
550- & mut Filter :: new ( ) . with_cite ( |mut cite| {
551- // Split any merged strings in the cite content back into separate Str/Space inlines
552- // Only split if the content contains spaces (i.e., hasn't been split yet)
553- let mut needs_split = false ;
554- for inline in & cite. content {
555- if let Inline :: Str ( s) = inline {
556- // Check for regular space or non-breaking space (U+00A0)
557- if s. text . contains ( ' ' ) || s. text . contains ( '\u{00A0}' ) {
558- needs_split = true ;
559- break ;
560- }
561- }
562- }
563-
564- if !needs_split {
565- return Unchanged ( cite) ;
566- }
567-
568- let mut new_content: Vec < Inline > = vec ! [ ] ;
569- for inline in cite. content {
570- if let Inline :: Str ( s) = inline {
571- // Split by regular spaces and non-breaking spaces
572- let words: Vec < & str > = s. text . split ( |c| c == ' ' || c == '\u{00A0}' ) . collect ( ) ;
573- for ( i, word) in words. iter ( ) . enumerate ( ) {
574- if i > 0 {
575- new_content. push ( Inline :: Space ( Space {
576- source_info : SourceInfo :: with_range ( empty_range ( ) ) ,
577- } ) ) ;
578- }
579- if !word. is_empty ( ) {
580- new_content. push ( Inline :: Str ( Str {
581- text : word. to_string ( ) ,
582- source_info : s. source_info . clone ( ) ,
583- } ) ) ;
584- }
585- }
586- } else {
587- new_content. push ( inline) ;
588- }
589- }
590- cite. content = new_content;
591- FilterResult ( vec ! [ Inline :: Cite ( cite) ] , true )
592- } ) ,
593- )
594- }
595-
596545/// Merge consecutive Str inlines and apply smart typography
597546pub fn merge_strs ( pandoc : Pandoc ) -> Pandoc {
598547 topdown_traverse (
0 commit comments