Skip to content

Commit

Permalink
ignoring corrected offset might be better solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigar Parekh committed Aug 10, 2018
1 parent cf00af2 commit d6f93d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ protected void tagCallback(int startOffset, int endOffset, Object docIdsKey) {
startOffset, endOffset);
return;
}
startOffset = offsetPair[0];
endOffset = offsetPair[1]<0?inputString.length():offsetPair[1];
if(offsetPair[0]>=0 && offsetPair[1]>=0 ) {
startOffset = offsetPair[0];
endOffset = offsetPair[1];
}
}

NamedList tag = new NamedList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class HtmlInterpolationTest extends XmlInterpolationTest {
public void setUp() throws Exception {
super.setUp();
baseParams.set("htmlOffsetAdjust", "true");
baseParams.set("matchText", "true");
}

@Override
Expand Down Expand Up @@ -58,6 +59,7 @@ public void testHtml() throws Exception {
assertXmlTag("start end <em>other text</em>", true);
assertXmlTag("start end<em> other text</em>", true);
assertXmlTag("<em>other text</em> start end", true);
assertXmlTag("start <td/> end", true);
}

@Test
Expand Down

0 comments on commit d6f93d1

Please sign in to comment.