25 #include <ArmarXGui/libraries/ArmarXGuiBase/ui_MarkdownEditor.h>
29 #include <QDesktopServices>
41 connect(ui->btnEdit, SIGNAL(toggled(
bool)),
this, SLOT(
toggleEditor(
bool)));
42 connect(ui->btnSyntax, SIGNAL(clicked()),
this, SLOT(
openSyntaxUrl()));
43 connect(ui->htmlView, SIGNAL(
textChanged()),
this, SLOT(__forwardTextChanged()));
55 if (ui->btnEdit->isChecked())
57 return ui->htmlView->toPlainText();
67 this->plainText = plainText;
69 if (ui->btnEdit->isChecked())
71 ui->htmlView->setPlainText(plainText);
83 if (rawString.length() > 0)
85 doc.
read(rawString.toStdString());
89 doc.
read(plainText.toStdString());
92 std::stringstream html;
94 ui->htmlView->setHtml(html.str().c_str());
101 ui->htmlView->setPlainText(plainText);
102 ui->htmlView->setReadOnly(
false);
106 plainText = ui->htmlView->toPlainText();
108 ui->htmlView->setReadOnly(
true);
117 QDesktopServices::openUrl(QUrl(
"https://help.github.com/articles/markdown-basics/"));
120 void MarkdownEditor::__forwardTextChanged()
122 if (ui->btnEdit->isChecked())