632 |
if (name.equals("text") || name.equals("link")) { |
if (name.equals("text") || name.equals("link")) { |
633 |
((List)tags.get("inline")).add(tag); |
((List)tags.get("inline")).add(tag); |
634 |
if (isFirstSentence) { |
if (isFirstSentence) { |
635 |
((List)tags.get("first")).add(tag); |
if (name.equals("text")) { |
636 |
|
String txt = ((TextTagImpl)tag).getText(); |
637 |
|
Tag newTag; |
638 |
|
if (txt.startsWith("<p>")) { |
639 |
|
newTag = new TextTagImpl(txt.substring(3)); |
640 |
|
} |
641 |
|
else if (txt.endsWith("</p>")) { |
642 |
|
newTag = new TextTagImpl(txt.substring(0, txt.length() - 4)); |
643 |
|
} |
644 |
|
else { |
645 |
|
newTag = tag; |
646 |
|
} |
647 |
|
((List)tags.get("first")).add(newTag); |
648 |
|
|
649 |
|
} |
650 |
|
else { |
651 |
|
((List)tags.get("first")).add(tag); |
652 |
|
} |
653 |
} |
} |
654 |
} |
} |
655 |
|
|
744 |
{ |
{ |
745 |
this.position = position; |
this.position = position; |
746 |
} |
} |
747 |
|
|
748 |
|
public void setPosition(SourcePosition position) |
749 |
|
{ |
750 |
|
this.position = position; |
751 |
|
} |
752 |
} |
} |
753 |
|
|