return findTitle(parseMarkdown(md));
}
private String findTitle(Node root) {
if (root instanceof HeaderNode) {
HeaderNode h = (HeaderNode) root;
if (h.getLevel() == 1
&& h.getChildren() != null
&& !h.getChildren().isEmpty()) {
StringBuilder b = new StringBuilder();
for (Node n : root.getChildren()) {
if (n instanceof TextNode) {
b.append(((TextNode) n).getText());
}