private Node parseTextBlock() { BlockNode blockNode = new BlockNode(); blockNode.setLineNumber(line()); blockNode.setFileName(filename); Token body = peek(); if(!(body instanceof PipelessText)){ return null; } this.advance(); ArrayList<String> values = body.getValues(); Node[] textNodes = {}; for (String value : values) { textNodes = ArrayUtils.addAll(textNodes,parseInlineTagsInText(value)); } blockNode.setNodes(new LinkedList<Node>(Arrays.asList(textNodes))); return blockNode; }
if (matcher.group(1) != null) { // escape text.setValue(str.substring(0, matcher.start()) + "#[");//Not sure if Matcher.end() is correct Node[] rest = this.parseInlineTagsInText(matcher.group(2)); if (rest[0] instanceof TextNode) { text.setValue(text.getValue() + rest[0].getValue()); return ArrayUtils.addAll(buffer, this.parseInlineTagsInText(rest.substring(range.getEnd() + 1)));
private Node parseText() { Token tok = expect(Text.class); Node[] tokens = this.parseInlineTagsInText(tok.getValue()); if (tokens.length == 1) return tokens[0]; BlockNode node = new BlockNode(); for (int i = 0; i < tokens.length; i++) { node.push(tokens[i]); } node.setValue(tok.getValue()); node.setLineNumber(tok.getLineNumber()); node.setFileName(filename); return node; }
private Node parseTextBlock() { BlockNode blockNode = new BlockNode(); blockNode.setLineNumber(line()); blockNode.setFileName(filename); Token body = peek(); if(!(body instanceof PipelessText)){ return null; } this.advance(); ArrayList<String> values = body.getValues(); Node[] textNodes = {}; for (String value : values) { textNodes = ArrayUtils.addAll(textNodes,parseInlineTagsInText(value)); } blockNode.setNodes(new LinkedList<Node>(Arrays.asList(textNodes))); return blockNode; }
if (matcher.group(1) != null) { // escape text.setValue(str.substring(0, matcher.start()) + "#[");//Not sure if Matcher.end() is correct Node[] rest = this.parseInlineTagsInText(matcher.group(2)); if (rest[0] instanceof TextNode) { text.setValue(text.getValue() + rest[0].getValue()); return ArrayUtils.addAll(buffer, this.parseInlineTagsInText(rest.substring(range.getEnd() + 1)));
private Node parseText() { Token tok = expect(Text.class); Node[] tokens = this.parseInlineTagsInText(tok.getValue()); if (tokens.length == 1) return tokens[0]; BlockNode node = new BlockNode(); for (int i = 0; i < tokens.length; i++) { node.push(tokens[i]); } node.setValue(tok.getValue()); node.setLineNumber(tok.getLineNumber()); node.setFileName(filename); return node; }