private void parseBoldAndItalicSpans(SpanManager sm,Span line,List<Span> boldSpans,List<Span> italicSpans){
  parseQuotedSpans(sm,line,boldSpans,"'''");
  parseQuotedSpans(sm,line,italicSpans,"''");
  int openTag=sm.indexOf("''",line);
  if (openTag != -1) {
    Span qs=new Span(openTag,line.getEnd());
    if (calculateSrcSpans) {
      qs.setSrcSpan(new SrcSpan(sm.getSrcPos(openTag),sm.getSrcPos(line.getEnd())));
    }
    if (sm.indexOf("'''",openTag,openTag + 3) != -1) {
      boldSpans.add(qs);
      sm.delete(openTag,openTag + 3);
    }
 else {
      italicSpans.add(qs);
      sm.delete(openTag,openTag + 2);
    }
  }
}

private void parseBoldAndItalicSpans ( SpanManager sm , Span line , List < Span > boldSpans , List < Span > italicSpans ) { parseQuotedSpans ( sm , line , boldSpans , "'''" ) ; parseQuotedSpans ( sm , line , italicSpans , "''" ) ; int openTag = sm . indexOf ( "''" , line ) ; if ( openTag != - 1 ) { Span qs = new Span ( openTag , line . getEnd ( ) ) ; if ( calculateSrcSpans ) { qs . setSrcSpan ( new SrcSpan ( sm . getSrcPos ( openTag ) , sm . getSrcPos ( line . getEnd ( ) ) ) ) ; } if ( sm . indexOf ( "'''" , openTag , openTag + 3 ) != - 1 ) { boldSpans . add ( qs ) ; sm . delete ( openTag , openTag + 3 ) ; } else { italicSpans . add ( qs ) ; sm . delete ( openTag , openTag + 2 ) ; } } }
searches a line for bold and italic quotations , this has to be done linewhise .
