public NanoPostPanel(NanoPost np, NBFrame nbf) {
        this.np = np;
        this.nbf = nbf;

        initComponents();

        this.panPostText.setText(HtmlUtils.markdownToHtml(HtmlUtils.stripHtmlTags(np.getPostText())).replaceAll("\n", "<br>"));
        this.lblPostHeader.setText(np.toString());

        if (np.getAttach() != null) {
            if (np.getAttach().isImage()) {
                drawAttachImage();
            } else {
                panAttach.setVisible(false);
            }
        } else {
            //drawNanopostImage();
            panAttach.setVisible(false);
            
            // Adjust JEditorPane size
            int width = this.getPreferredSize().width;
            this.setPreferredSize(new Dimension(width, getContentHeight(HtmlUtils.stripHtmlTags(np.getPostText())) + panPostHeader.getPreferredSize().height + 6));
        }
    }