private void updateLineContent(String content, boolean rendered) {
        String[] lineContents = content.split("\n");

        if (lineContents.length == 0) {
//            lines.clear();
            return;
        }

        if (node instanceof Line) {
            Line line = (Line) node;
            line.setContent(lineContents[0]);
        } else {
            Block block = (Block) node;
            for (int i = 0; i < Math.min(lineContents.length, block.getChildren().size()); ++i) {
                Line line = (Line) block.getChildren().get(i);
                line.setContent(lineContents[i]);
            }

            if (block.getChildren().size() > lineContents.length) {
                for (int i = lineContents.length; i < block.getChildren().size(); ++i) {
                    block.getChildren().remove(lineContents.length);
                }
            }

            if (lineContents.length > block.getChildren().size()) {
                Line last = (Line) block.getChildren().get(block.getChildren().size() - 1);
                for (int i = block.getChildren().size(); i < lineContents.length; ++i) {
                    Line line = new Line(last.getLeftUpperCornerX(), last.getLeftUpperCornerY() + last.getHeight(), last.getWidth(), last.getHeight());
                    line.setParent(last.getParent());
                    line.setContent(lineContents[i]);
                    ((Block) last.getParent()).addChild(line);
                }
            }
        }

    }