@Test public void attribute_value_starting_with_quote() { StringReader reader = new StringReader("<img src=\"'a'\"/>"); List<Node> nodeList = new PageLexer().parse(reader); assertEquals(1, nodeList.size()); assertTrue(nodeList.get(0) instanceof TagNode); TagNode node = (TagNode) nodeList.get(0); Attribute attribute = node.getAttributes().get(0); assertEquals("src", attribute.getName()); assertEquals("'a'", attribute.getValue()); }
public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; } }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }  }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }  @SuppressWarnings("rawtypes") List<Node> nestedParse(CodeReader reader); List<Node> parse(Reader reader); }
PageLexer { public List<Node> parse(Reader reader) { CodeReader codeReader = new CodeReader(reader); List<Node> nodeList = new ArrayList<>(); ChannelDispatcher<List<Node>> channelDispatcher = ChannelDispatcher.builder().addChannels((Channel[]) tokenizers.toArray(new Channel[tokenizers.size()])).build(); channelDispatcher.consume(codeReader, nodeList); createNodeHierarchy(nodeList); return nodeList; }  @SuppressWarnings("rawtypes") List<Node> nestedParse(CodeReader reader); List<Node> parse(Reader reader);  }