private static void checkRange( ContentElement ce ){ List<SrcSpan> eil = new ArrayList<SrcSpan>(); for( Span s: ce.getFormatSpans( FormatType.BOLD ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.ITALIC ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.MATH ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.TAG ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.NOWIKI ) ) eil.add( s.getSrcSpan() ); for( Link l: ce.getLinks()) eil.add( l.getSrcSpan() ); for( Template t: ce.getTemplates() ) eil.add( t.getSrcSpan() ); ce.setSrcSpan( getEvalInfo( ce.getSrcSpan(), eil) ); }
} else if (l != lang.getLanguage()) { ParsedIll pill = new ParsedIll(); pill.location = new ParsedLocation(xml, -1, -1, ill.getSrcSpan().getStart()); pill.title = new Title(target, false, LanguageInfo.getByLanguage(l)); visitIll(pill);
private void parseCategory(RawPage xml, ParsedPage pp){ // handle categories for (Link cat : pp.getCategories()){ Title destTitle = new Title(cat.getTarget(), lang); // TODO: ensure title is a category ParsedCategory pc = new ParsedCategory(); pc.location = new ParsedLocation(xml, -1, -1, cat.getSrcSpan().getStart()); pc.category = destTitle; visitCategory(pc); } // handle ILLs parseIlls(xml, pp); }
ParsedLink.SubarticleType linkSubType; if (secSubType == null){ // don't look for inlines in "see also" linkSubType = subarticleParser.isInlineSubarticle(curLink.getSrcSpan().getStart(), xml); }else{ ParsedLocation location = new ParsedLocation(xml, secNum, paraNum, curLink.getSrcSpan().getStart()); visitLink(location, destTitle, curLink.getText(), linkSubType); } catch (WikiBrainException e) { pc.location = new ParsedLocation(xml, -1, -1, cat.getSrcSpan().getStart()); pc.category = destTitle; visitCategory(pc);