@Test public void createInline() { assertNoInline(createCursor("httpx: assertNoInline(createCursor("http:/")); assertLink(0, 28, "http: createCursor("http: assertLink(0, 23, "https: createCursor("https: assertLink(1, 23, "https: createCursor("(https: }
@Override public Optional<? extends Inline> createInline(Cursor cursor) { if (cursor.getChar() == 'h') { Matcher matcher = cursor.matcher(linkPattern); if (matcher.matches()) { String href = matcher.group(1); String link = href; int endOffset = cursor.getOffset(matcher.end(1)); int linkLength = endOffset - cursor.getOffset(); return Optional.of(new Link(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, escapeUri(link), null, ImmutableList.<Inline> of( new Characters(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, href)))); } } return Optional.empty(); }
AutoLinkWithoutDemarcationSpan extends SourceSpan { @Override public Optional<? extends Inline> createInline(Cursor cursor) { if (cursor.getChar() == 'h') { Matcher matcher = cursor.matcher(linkPattern); if (matcher.matches()) { String href = matcher.group(1); String link = href; int endOffset = cursor.getOffset(matcher.end(1)); int linkLength = endOffset - cursor.getOffset(); return Optional.of(new Link(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, escapeUri(link), null, ImmutableList.<Inline> of( new Characters(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, href)))); } } return Optional.empty(); } }
AutoLinkWithoutDemarcationSpan extends SourceSpan { @Override public Optional<? extends Inline> createInline(Cursor cursor) { if (cursor.getChar() == 'h') { Matcher matcher = cursor.matcher(linkPattern); if (matcher.matches()) { String href = matcher.group(1); String link = href; int endOffset = cursor.getOffset(matcher.end(1)); int linkLength = endOffset - cursor.getOffset(); return Optional.of(new Link(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, escapeUri(link), null, ImmutableList.<Inline> of( new Characters(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, href)))); } } return Optional.empty(); }  }
AutoLinkWithoutDemarcationSpan extends SourceSpan { @Override public Optional<? extends Inline> createInline(Cursor cursor) { if (cursor.getChar() == 'h') { Matcher matcher = cursor.matcher(linkPattern); if (matcher.matches()) { String href = matcher.group(1); String link = href; int endOffset = cursor.getOffset(matcher.end(1)); int linkLength = endOffset - cursor.getOffset(); return Optional.of(new Link(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, escapeUri(link), null, ImmutableList.<Inline> of( new Characters(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, href)))); } } return Optional.empty(); }  @Override Optional<? extends Inline> createInline(Cursor cursor); }
AutoLinkWithoutDemarcationSpan extends SourceSpan { @Override public Optional<? extends Inline> createInline(Cursor cursor) { if (cursor.getChar() == 'h') { Matcher matcher = cursor.matcher(linkPattern); if (matcher.matches()) { String href = matcher.group(1); String link = href; int endOffset = cursor.getOffset(matcher.end(1)); int linkLength = endOffset - cursor.getOffset(); return Optional.of(new Link(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, escapeUri(link), null, ImmutableList.<Inline> of( new Characters(cursor.getLineAtOffset(), cursor.getOffset(), linkLength, href)))); } } return Optional.empty(); }  @Override Optional<? extends Inline> createInline(Cursor cursor);  }