public boolean isEmpty() { for (TableCell cell : cells) { if (cell != null && !cell.text.isBlank()) return false; } return true; }
public boolean isEmptyColumn(int column) { int index = indexOf(column).index; return index >= cells.size() || cells.get(index).text.isBlank(); }
public BasedSequence getInfoDelimitedByAny(CharSequence delimiters) { BasedSequence language = BasedSequence.NULL; if (info.isNotNull() && !info.isBlank()) { int space = info.indexOfAny(delimiters); if (space == -1) { language = info; } else { language = info.subSequence(0, space); } } return language; }
append = !(caption.isBlank()); break;
if (tableCell.text.isBlank() || count > 1) {
@Override public void closeBlock(ParserState state) { // trim trailing blank lines out of the block if (trimTrailingBlankLines) { int trailingBlankLines = 0; List<BasedSequence> lines = content.getLines(); for (BasedSequence line : new Reverse<BasedSequence>(lines)) { if (!line.isBlank()) break; trailingBlankLines++; } if (trailingBlankLines > 0) block.setContent(lines.subList(0, lines.size() - trailingBlankLines)); else block.setContent(content); } else { block.setContent(content); } if (codeContentBlock) { CodeBlock codeBlock = new CodeBlock(block.getChars(), block.getContentLines()); block.appendChild(codeBlock); } content = null; }
if (lines.size() > 0) { BasedSequence info = lines.get(0); if (!info.isBlank()) { block.setInfo(info.trim());
BasedSequence contentChars = blockChars.subSequence(pos + blockChars.countChars(BasedSequence.WHITESPACE_CHARS, pos, blockChars.length())); if (contentChars.isBlank()) {
private void visit(final TableCell node) { BasedSequence text = node.getText(); if (options.trimCellWhitespace) { if (text.isBlank() && !text.isEmpty()) { text = text.subSequence(0, 1); } else { text = text.trim(); } } myTable.addCell(new com.vladsch.flexmark.util.format.TableCell(node.getOpeningMarker(), text, node.getClosingMarker(), 1, node.getSpan(), node.getAlignment() == null ? CellAlignment.NONE : node.getAlignment().cellAlignment())); } }
if (!attributeNode.isImplicitName()) { final BasedSequence attributeNodeName = attributeNode.getName(); if (attributeNodeName.isNotNull() && !attributeNodeName.isBlank()) { if (!attributeNodeName.equals(CLASS_ATTR)) { attributes.remove(attributeNodeName);
if (adjustedCell.trackedTextOffset != NOT_TRACKED) { int cellOffset = out.offsetWithPending(); int adjustForBlank = cell.text.isBlank() ? -1 : 0; trackedOffsets.put(cell.trackedTextOffset + cell.getTextStartOffset(i == 0 ? null : row.cells.get(i - 1)), cellOffset + minLimit(adjustedCell.trackedTextOffset + adjustForBlank, 0) + adjustedCell.trackedTextAdjust);
private void render(FencedCodeBlock node, NodeRendererContext context, HtmlWriter html) { BasedSequence info = node.getInfo(); if (info.isNotNull() && !info.isBlank()) { html.line().raw("{code:lang=" + info.unescape() + "}").line(); } else { html.line().raw("{code}").line(); } html.raw(node.getContentChars().normalizeEOL()); html.line().raw("{code}").blankLine(); }
private void render(FencedCodeBlock node, NodeRendererContext context, HtmlWriter html) { BasedSequence info = node.getInfo(); if (info.isNotNull() && !info.isBlank()) { html.line().raw("{code:lang=" + info.unescape() + "}").line(); } else { html.line().raw("{code}").line(); } html.raw(node.getContentChars().normalizeEOL()); html.line().raw("{code}").blankLine(); }
boolean addCloseCaptionSpace = false; if (!captionCell.text.isBlank()) { switch (options.formatTableCaptionSpaces) { case ADD: TableCell adjustedCell = row.cells.get(0); if (adjustedCell.trackedTextOffset != NOT_TRACKED) { trackedOffsets.put(cell.trackedTextOffset + cell.text.getStartOffset(), cellOffset + (cellText.isBlank() ? 1 : minLimit(adjustedCell.trackedTextOffset, 0) + adjustedCell.trackedTextAdjust));
void render(FencedCodeBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); html.srcPosWithTrailingEOL(node.getChars()).withAttr().tag("pre").openPre(); BasedSequence info = node.getInfo(); if (info.isNotNull() && !info.isBlank()) { BasedSequence language = node.getInfoDelimitedByAny(" "); html.attr("class", context.getHtmlOptions().languageClassPrefix + language.unescape()); } else { String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if (!noLanguageClass.isEmpty()) { html.attr("class", noLanguageClass); } } html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().normalizeEOL()); } html.tag("/code"); html.tag("/pre").closePre(); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); }
myPendingEOL--; if (myPendingEOL > 0 && !myPrefix.isBlank()) { myAppendable.append(myPrefix);
if (prev.getEndOffset() <= next.getStartOffset()) { BasedSequence sequence = prev.baseSubSequence(prev.getEndOffset(), next.getStartOffset()); if (!sequence.isEmpty() && sequence.isBlank()) { if (!preserve) { if (collapseToEOL && sequence.indexOfAny(BasedSequence.EOL_CHARS) != -1) {
BasedSequence text = node.getText(); if (options.trimCellWhitespace) { if (text.isBlank() && !text.isEmpty()) { text = text.subSequence(0, 1); } else {