Skip to content

Stop URL on < or > #7

Closed
Closed
@tsl0922

Description

@tsl0922

code to reproduce:

String input = "wow <p>http://test.com</p> such linked";
LinkExtractor linkExtractor = LinkExtractor.builder().build();
Iterable<LinkSpan> links = linkExtractor.extractLinks(input);
String result = Autolink.renderLinks(input, links, (link, text, sb) -> {
    sb.append("<a href=\"");
    sb.append(text, link.getBeginIndex(), link.getEndIndex());
    sb.append("\">");
    sb.append(text, link.getBeginIndex(), link.getEndIndex());
    sb.append("</a>");
});
System.out.println(result);

expect:

wow <p><a href="http://test.com">http://test.com</a></p> such linked

actual:

wow <p><a href="http://test.com</p>">http://test.com</p></a> such linked

This seems to be a bug, do we support the skip_tags feature of rinku?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions