@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { BasedSequence line = state.getLine(); if (state.getIndex() == 0) { int breakLength = myOptions.exampleBreak.length(); if (line.length() >= breakLength + 1 + EXAMPLE_KEYWORD.length() && line.startsWith(myOptions.exampleBreak) && line.matchChars(EXAMPLE_KEYWORD, breakLength + 1) && " \t\u00A0".contains(String.valueOf(line.charAt(breakLength)))) { SpecExampleBlockParser blockParser = new SpecExampleBlockParser(state.getProperties()); blockParser.block.setOpeningMarker(line.subSequence(0, breakLength)); //blockParser.addLine(state, state.getLineWithEOL()); return BlockStart.of(blockParser).atIndex(-1); } } return BlockStart.none(); } }
for (String suffix : markerSuffixes) { int suffixLength = suffix.length(); if (suffixLength > 0 && line.matchChars(suffix, contentIndex)) { if (options.isItemMarkerSpace()) { final char c = line.midCharAt(contentIndex + suffixLength);
if (options.group(GROUP_OPTIONS_CLOSE) != null && !options.group(GROUP_OPTIONS_CLOSE).trim().isEmpty()){optionsClosingMarker = optionsChars.subSequence(options.start(GROUP_OPTIONS_CLOSE), options.end(GROUP_OPTIONS_CLOSE)).trim(WHITESPACE_NBSP_CHARS);} if (section.isNotNull() && optionsKeyword.isNull() && numberSeparator.isNull() && coordOpeningMarker.isNull() && section.matchChars("options")) { if (line.length() == typeBreakLength + line.countTrailing(BasedSequence.EOL_CHARS) && line.matchChars(typeBreak)) { if (inSource) { inSource = false;
@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { BasedSequence line = state.getLine(); if (state.getIndex() == 0) { int breakLength = myOptions.exampleBreak.length(); if (line.length() >= breakLength + 1 + EXAMPLE_KEYWORD.length() && line.startsWith(myOptions.exampleBreak) && line.matchChars(EXAMPLE_KEYWORD, breakLength + 1) && " \t\u00A0".contains(String.valueOf(line.charAt(breakLength)))) { SpecExampleBlockParser blockParser = new SpecExampleBlockParser(state.getProperties()); blockParser.block.setOpeningMarker(line.subSequence(0, breakLength)); //blockParser.addLine(state, state.getLineWithEOL()); return BlockStart.of(blockParser).atIndex(-1); } } return BlockStart.none(); } }
for (String suffix : markerSuffixes) { int suffixLength = suffix.length(); if (suffixLength > 0 && line.matchChars(suffix, contentIndex)) { if (options.isItemMarkerSpace()) { final char c = line.midCharAt(contentIndex + suffixLength);
if (options.group(GROUP_OPTIONS_CLOSE) != null && !options.group(GROUP_OPTIONS_CLOSE).trim().isEmpty()){optionsClosingMarker = optionsChars.subSequence(options.start(GROUP_OPTIONS_CLOSE), options.end(GROUP_OPTIONS_CLOSE)).trim(WHITESPACE_NBSP_CHARS);} if (section.isNotNull() && optionsKeyword.isNull() && numberSeparator.isNull() && coordOpeningMarker.isNull() && section.matchChars("options")) { if (line.length() == typeBreakLength + line.countTrailing(BasedSequence.EOL_CHARS) && line.matchChars(typeBreak)) { if (inSource) { inSource = false;