mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-31 01:50:47 +03:00
Merge branch '0.7.0-dev' of ssh://github.com/Nheko-Reborn/nheko into 0.7.0-dev
This commit is contained in:
commit
a997497524
3 changed files with 22 additions and 3 deletions
|
@ -4,6 +4,10 @@ set -ex
|
|||
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
brew update
|
||||
|
||||
# uninstall packages, that would get upgraded by upgrading cmake (and we don't need)
|
||||
brew uninstall --force cgal node sfcgal postgis
|
||||
|
||||
brew install qt5 lmdb clang-format ninja libsodium cmark
|
||||
brew upgrade boost cmake icu4c || true
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ for iconSize in 16 32 48 64 128 256 512; do
|
|||
done
|
||||
|
||||
# Only download the file when not already present
|
||||
if ! [ -f linuxdeployqt-continuous-x86_64.AppImage ] ; then
|
||||
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
|
||||
if ! [ -f linuxdeployqt-6-x86_64.AppImage ] ; then
|
||||
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage"
|
||||
fi
|
||||
chmod a+x linuxdeployqt*.AppImage
|
||||
|
||||
|
|
|
@ -324,10 +324,25 @@ utils::linkifyMessage(const QString &body)
|
|||
return doc;
|
||||
}
|
||||
|
||||
QByteArray escapeRawHtml(const QByteArray &data) {
|
||||
QByteArray buffer;
|
||||
const size_t length = data.size();
|
||||
buffer.reserve(length);
|
||||
for(size_t pos = 0; pos != length; ++pos) {
|
||||
switch(data.at(pos)) {
|
||||
case '&': buffer.append("&"); break;
|
||||
case '<': buffer.append("<"); break;
|
||||
case '>': buffer.append(">"); break;
|
||||
default: buffer.append(data.at(pos)); break;
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
QString
|
||||
utils::markdownToHtml(const QString &text)
|
||||
{
|
||||
const auto str = text.toUtf8();
|
||||
const auto str = escapeRawHtml(text.toUtf8());
|
||||
const char *tmp_buf =
|
||||
cmark_markdown_to_html(str.constData(), str.size(), CMARK_OPT_DEFAULT);
|
||||
|
||||
|
|
Loading…
Reference in a new issue