public InlineLinkNode(BasedSequence chars, BasedSequence textOpeningMarker, BasedSequence text, BasedSequence textClosingMarker, BasedSequence linkOpeningMarker, BasedSequence url, BasedSequence titleOpeningMarker, BasedSequence title, BasedSequence titleClosingMarker, BasedSequence linkClosingMarker) { super(chars); this.textOpeningMarker = textOpeningMarker; this.text = text.trim(); this.textClosingMarker = textClosingMarker; this.linkOpeningMarker = linkOpeningMarker; this.url = url; this.titleOpeningMarker = titleOpeningMarker; this.title = title; this.titleClosingMarker = titleClosingMarker; this.linkClosingMarker = linkClosingMarker; }
public InlineLinkNode(BasedSequence textOpeningMarker, BasedSequence text, BasedSequence textClosingMarker, BasedSequence linkOpeningMarker, BasedSequence url, BasedSequence titleOpeningMarker, BasedSequence title, BasedSequence titleClosingMarker, BasedSequence linkClosingMarker) { this.textOpeningMarker = textOpeningMarker; this.text = text.trim(); this.textClosingMarker = textClosingMarker; this.linkOpeningMarker = linkOpeningMarker; this.url = url; this.titleOpeningMarker = titleOpeningMarker; this.title = title; this.titleClosingMarker = titleClosingMarker; this.linkClosingMarker = linkClosingMarker; }
public InlineLinkNode(BasedSequence chars, BasedSequence textOpeningMarker, BasedSequence text, BasedSequence textClosingMarker, BasedSequence linkOpeningMarker, BasedSequence url, BasedSequence linkClosingMarker) { super(chars); this.textOpeningMarker = textOpeningMarker; this.text = text.trim(); this.textClosingMarker = textClosingMarker; this.linkOpeningMarker = linkOpeningMarker; this.url = url; this.linkClosingMarker = linkClosingMarker; }
public InlineLinkNode(BasedSequence textOpeningMarker, BasedSequence text, BasedSequence textClosingMarker, BasedSequence linkOpeningMarker, BasedSequence url, BasedSequence linkClosingMarker) { this.textOpeningMarker = textOpeningMarker; this.text = text.trim(); this.textClosingMarker = textClosingMarker; this.linkOpeningMarker = linkOpeningMarker; this.url = url; this.linkClosingMarker = linkClosingMarker; }
public void setText(BasedSequence text) { this.text = text.trim(); }
private static List<Alignment> parseAlignment(BasedSequence separatorLine) { List<BasedSequence> parts = split(separatorLine); List<Alignment> alignments = new ArrayList<Alignment>(); for (BasedSequence part : parts) { BasedSequence trimmed = part.trim(); boolean left = trimmed.startsWith(":"); boolean right = trimmed.endsWith(":"); Alignment alignment = getAlignment(left, right); alignments.add(alignment); } return alignments; }
private List<TableCell.Alignment> parseAlignment(BasedSequence separatorLine) { List<BasedSequence> parts = split(separatorLine, false, false); List<TableCell.Alignment> alignments = new ArrayList<TableCell.Alignment>(); for (BasedSequence part : parts) { BasedSequence trimmed = part.trim(); boolean left = trimmed.startsWith(":"); boolean right = trimmed.endsWith(":"); TableCell.Alignment alignment = getAlignment(left, right); alignments.add(alignment); } return alignments; }
public void setCaptionWithMarkers( final CharSequence captionOpen, final CharSequence caption, final CharSequence captionClose ) { setCaptionCell(new TableCell(captionOpen, options.formatTableCaptionSpaces == DiscretionaryText.AS_IS ? caption : BasedSequenceImpl.of(caption).trim(), captionClose, 1, 1)); }
@Override public void setTextChars(final BasedSequence textChars) { verifyBasedSequence(textChars, 0); int textCharsLength = textChars.length(); textOpeningMarker = textChars.subSequence(0, PREFIX.length() + 1); // grab n characters, n - 1 for the PREFIX and 1 for the opener text = textChars.subSequence(PREFIX.length() + 2, textCharsLength - 1).trim(); textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength); }
@Override public void setTextChars(BasedSequence textChars) { int textCharsLength = textChars.length(); this.textOpeningMarker = textChars.subSequence(0, 2); this.text = textChars.subSequence(2, textCharsLength - 1).trim(); this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength); } }
public void setTextChars(BasedSequence textChars) { int textCharsLength = textChars.length(); this.textOpeningMarker = textChars.subSequence(0, 1); this.text = textChars.subSequence(1, textCharsLength - 1).trim(); this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength); }
@Override public void setTextChars(BasedSequence textChars) { int textCharsLength = textChars.length(); this.textOpeningMarker = textChars.subSequence(0, 2); this.text = textChars.subSequence(2, textCharsLength - 1).trim(); this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength); }
@Override public void setTextChars(BasedSequence textChars) { int textCharsLength = textChars.length(); this.textOpeningMarker = textChars.subSequence(0, 1); this.text = textChars.subSequence(1, textCharsLength - 1).trim(); this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength); } }
@Override public void setTextChars(final BasedSequence textChars) { int textCharsLength = textChars.length(); this.textOpeningMarker = textChars.subSequence(0, 1); this.text = textChars.subSequence(1, textCharsLength - 1).trim(); this.textClosingMarker = textChars.subSequence(textCharsLength - 1, textCharsLength); } }
public void setReferenceChars(BasedSequence referenceChars) { int referenceCharsLength = referenceChars.length(); int openingOffset = referenceChars.charAt(0) == '!' ? 2 : 1; this.referenceOpeningMarker = referenceChars.subSequence(0, openingOffset); this.reference = referenceChars.subSequence(openingOffset, referenceCharsLength - 1).trim(); this.referenceClosingMarker = referenceChars.subSequence(referenceCharsLength - 1, referenceCharsLength); }
@Override public Node createNode(BasedSequence nodeChars) { BasedSequence footnoteId = nodeChars.midSequence(2, -1).trim(); FootnoteBlock footnoteBlock = footnoteId.length() > 0 ? footnoteRepository.get(footnoteId.toString()) : null; Footnote footnote = new Footnote(nodeChars.subSequence(0, 2), footnoteId, nodeChars.endSequence(1)); footnote.setFootnoteBlock(footnoteBlock); if (footnoteBlock != null) { footnoteRepository.addFootnoteReference(footnoteBlock, footnote); } return footnote; }
@Override public boolean parse(final InlineParser inlineParser) { if (inlineParser.peek(1) == '%' && (inlineParser.peek(2) == ' ' || inlineParser.peek(2) == '\t')) { BasedSequence input = inlineParser.getInput(); Matcher matcher = inlineParser.matcher(parsing.MACRO_TAG); if (matcher != null) { BasedSequence tag = input.subSequence(matcher.start(), matcher.end()); BasedSequence tagName = input.subSequence(matcher.start(1), matcher.end(1)); BasedSequence parameters = input.subSequence(matcher.end(1), matcher.end() - 2).trim(); JekyllTag macro = new JekyllTag(tag.subSequence(0, 2), tagName, parameters, tag.endSequence(2)); macro.setCharsFromContent(); //noinspection EqualsBetweenInconvertibleTypes if (!listIncludesOnly || tagName.equals(JekyllTagBlockParser.INCLUDE_TAG)) { List<JekyllTag> tagList = JekyllTagExtension.TAG_LIST.getFrom(inlineParser.getDocument()); tagList.add(macro); } inlineParser.flushTextNode(); inlineParser.getBlock().appendChild(macro); return true; } } return false; }
@Override public Node createNode(BasedSequence nodeChars) { BasedSequence enumeratedReferenceId = nodeChars.midSequence(2, -1).trim(); EnumeratedReferenceBlock enumeratedReferenceBlock = enumeratedReferenceId.length() > 0 ? enumeratedReferenceRepository.get(enumeratedReferenceId.toString()) : null; if (nodeChars.charAt(1) == '@') { // reference link EnumeratedReferenceLink enumeratedReference = new EnumeratedReferenceLink(nodeChars.subSequence(0, 2), enumeratedReferenceId, nodeChars.endSequence(1)); enumeratedReference.setEnumeratedReferenceBlock(enumeratedReferenceBlock); return enumeratedReference; } else { // reference text EnumeratedReferenceText enumeratedReferenceText = new EnumeratedReferenceText(nodeChars.subSequence(0, 2), enumeratedReferenceId, nodeChars.endSequence(1)); enumeratedReferenceText.setEnumeratedReferenceBlock(enumeratedReferenceBlock); return enumeratedReferenceText; } }
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())); } }
public Reference(BasedSequence label, BasedSequence url, BasedSequence title) { super(BasedSequence.NULL); this.openingMarker = label.subSequence(0, 1); this.reference = label.subSequence(1, label.length() - 2).trim(); this.closingMarker = label.subSequence(label.length() - 2, label.length()); setUrlChars(url); if (title != null) { this.titleOpeningMarker = title.subSequence(0, 1); this.title = title.subSequence(1, title.length() - 1); this.titleClosingMarker = title.subSequence(title.length() - 1, title.length()); } setCharsFromContent(); }