AsciiDoctorInlineAnchor implements AsciidoctorTextSelectable { public String getId() { return id; } AsciiDoctorInlineAnchor(String text, int position, int end); String getLabel(); @Override int getPosition(); int getEnd(); String getId(); @Override int getSelectionStart(); @Override int getSelectionLength();  }
@Test public void anchor_with_spaces_inside_are_trimmed() { assertEquals("mysection", new AsciiDoctorInlineAnchor("[[ mysection ]]", -1, -1).getId()); }
@Test public void anchor_containing_comma_will_use_only_first_one() { assertEquals("mysection", new AsciiDoctorInlineAnchor("[[mysection,here]]", -1, -1).getId()); assertEquals("mysection", new AsciiDoctorInlineAnchor("[[mysection ,here]]", -1, -1).getId()); assertEquals("mysection", new AsciiDoctorInlineAnchor("[[mysection, here]]", -1, -1).getId()); }
@Test public void label_alpha_has_alpha_as_id() { assertEquals("alpha", new AsciiDoctorInlineAnchor("[[alpha]]", -1, -1).getId()); }
@Test public void label_alpha_hyphen_rocks_da_house_has_alpha_hyphen_rocks_da_house_as_id() { assertEquals("alpha-rocksdahouse", new AsciiDoctorInlineAnchor("[[alpha-rocksdahouse]]", -1, -1).getId()); }
@Test public void label_null_has_illegal_id() { assertTrue(new AsciiDoctorInlineAnchor(null, -1, -1).getId().startsWith("illegal")); }