@Test public void canStart() { assertFalse(block.canStart(LineSequence.create(""))); assertFalse(block.canStart(LineSequence.create("a"))); assertFalse(block.canStart(LineSequence.create(" ***"))); for (char c : "*_-".toCharArray()) { String hrIndicator = Strings.repeat("" + c, 3); assertTrue(block.canStart(LineSequence.create(" " + hrIndicator))); assertTrue(block.canStart(LineSequence.create(" " + hrIndicator))); assertTrue(block.canStart(LineSequence.create(" " + hrIndicator))); assertFalse(block.canStart(LineSequence.create(" " + hrIndicator))); assertTrue(block.canStart(LineSequence.create(hrIndicator))); assertTrue(block.canStart(LineSequence.create(Strings.repeat("" + c, 4)))); assertTrue(block.canStart(LineSequence.create(Strings.repeat("" + c, 14)))); } assertFalse(block.canStart(LineSequence.create("\t***"))); }
@Override public boolean canStart(LineSequence lineSequence) { Line line = lineSequence.getCurrentLine(); return line != null && PATTERN.matcher(line.getText()).matches(); }
HorizontalRuleBlock extends SourceBlock { @Override public boolean canStart(LineSequence lineSequence) { Line line = lineSequence.getCurrentLine(); return line != null && PATTERN.matcher(line.getText()).matches(); } }
HorizontalRuleBlock extends SourceBlock { @Override public boolean canStart(LineSequence lineSequence) { Line line = lineSequence.getCurrentLine(); return line != null && PATTERN.matcher(line.getText()).matches(); }  }
HorizontalRuleBlock extends SourceBlock { @Override public boolean canStart(LineSequence lineSequence) { Line line = lineSequence.getCurrentLine(); return line != null && PATTERN.matcher(line.getText()).matches(); }  @Override void process(ProcessingContext context, DocumentBuilder builder, LineSequence lineSequence); @Override boolean canStart(LineSequence lineSequence); }
HorizontalRuleBlock extends SourceBlock { @Override public boolean canStart(LineSequence lineSequence) { Line line = lineSequence.getCurrentLine(); return line != null && PATTERN.matcher(line.getText()).matches(); }  @Override void process(ProcessingContext context, DocumentBuilder builder, LineSequence lineSequence); @Override boolean canStart(LineSequence lineSequence);  }