public Content getNonBreakResource ( String key ) { String text = configuration . getText ( key ) ; Content c = configuration . newContent ( ) ; int start = 0 ; int p ; while ( ( p = text . indexOf ( " " , start ) ) != - 1 ) { c . addContent ( text . substring ( start , p ) ) ; c . addContent ( RawHtml . nbsp ) ; start = p + 1 ; } c . addContent ( text . substring ( start ) ) ; return c ; }
Get the configuration string as a content replacing spaces with non - breaking spaces .