Compare commits
19 Commits
fix-editin
...
v1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c96109e9b7 | ||
|
|
3f01b3badf | ||
|
|
093412c788 | ||
|
|
c5ddb61981 | ||
|
|
ad4e52b20d | ||
|
|
5991d59ddd | ||
|
|
de49a26462 | ||
|
|
4924702c15 | ||
|
|
8060edd1c6 | ||
|
|
89bf5d3a31 | ||
|
|
60762b934c | ||
|
|
7729fec259 | ||
|
|
026769b07f | ||
|
|
5be14a4b8f | ||
|
|
0b70d2b33f | ||
|
|
dab77b8d07 | ||
|
|
2acdf61b16 | ||
|
|
defa3d4b77 | ||
|
|
be709a2732 |
@@ -20,10 +20,12 @@ include(KDEClangFormat)
|
|||||||
include(KDECMakeSettings)
|
include(KDECMakeSettings)
|
||||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||||
|
|
||||||
|
include(cmake/Flatpak.cmake)
|
||||||
|
|
||||||
# Fix a crash due to problems with quotient's event system. Can probably be removed once the reworked event system is in
|
# Fix a crash due to problems with quotient's event system. Can probably be removed once the reworked event system is in
|
||||||
cmake_policy(SET CMP0063 OLD)
|
cmake_policy(SET CMP0063 OLD)
|
||||||
|
|
||||||
ecm_setup_version(0.1.0
|
ecm_setup_version(1.0.0
|
||||||
VARIABLE_PREFIX NEOCHAT
|
VARIABLE_PREFIX NEOCHAT
|
||||||
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h
|
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h
|
||||||
)
|
)
|
||||||
@@ -58,6 +60,7 @@ ecm_find_qmlmodule(org.kde.kquickimageeditor 1.0)
|
|||||||
|
|
||||||
find_package(KQuickImageEditor COMPONENTS)
|
find_package(KQuickImageEditor COMPONENTS)
|
||||||
set_package_properties(KQuickImageEditor PROPERTIES
|
set_package_properties(KQuickImageEditor PROPERTIES
|
||||||
|
TYPE REQUIRED
|
||||||
DESCRIPTION "Simple image editor for QtQuick applications"
|
DESCRIPTION "Simple image editor for QtQuick applications"
|
||||||
URL "https://invent.kde.org/libraries/kquickimageeditor/"
|
URL "https://invent.kde.org/libraries/kquickimageeditor/"
|
||||||
PURPOSE "Add image editing capability to image attachments"
|
PURPOSE "Add image editing capability to image attachments"
|
||||||
@@ -65,7 +68,7 @@ set_package_properties(KQuickImageEditor PROPERTIES
|
|||||||
|
|
||||||
install(FILES org.kde.neochat.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
install(FILES org.kde.neochat.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||||
install(FILES org.kde.neochat.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
install(FILES org.kde.neochat.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
||||||
install(FILES neochat.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
install(FILES org.kde.neochat.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
||||||
install(FILES neochat.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
|
install(FILES neochat.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
|
||||||
|
|
||||||
# add_definitions(-DQT_NO_KEYWORDS) Need to fix libQuotient first
|
# add_definitions(-DQT_NO_KEYWORDS) Need to fix libQuotient first
|
||||||
|
|||||||
16
cmake/Flatpak.cmake
Normal file
16
cmake/Flatpak.cmake
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if(NOT NEOCHAT_FLATPAK)
|
||||||
|
# Only include this if we build a Flatpak
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
# Include FontConfig config which uses the Emoji One font from the
|
||||||
|
# KDE Flatpak SDK.
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Flatpak/99-noto-mono-color-emoji.conf
|
||||||
|
DESTINATION
|
||||||
|
${CMAKE_INSTALL_SYSCONFDIR}/fonts/conf.d/
|
||||||
|
)
|
||||||
|
|
||||||
23
cmake/Flatpak/99-noto-mono-color-emoji.conf
Normal file
23
cmake/Flatpak/99-noto-mono-color-emoji.conf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||||
|
<fontconfig>
|
||||||
|
<alias>
|
||||||
|
<family>serif</family>
|
||||||
|
<prefer>
|
||||||
|
<family>Emoji One</family>
|
||||||
|
</prefer>
|
||||||
|
</alias>
|
||||||
|
<alias>
|
||||||
|
<family>sans-serif</family>
|
||||||
|
<prefer>
|
||||||
|
<family>Emoji One</family>
|
||||||
|
</prefer>
|
||||||
|
</alias>
|
||||||
|
<alias>
|
||||||
|
<family>monospace</family>
|
||||||
|
<prefer>
|
||||||
|
<family>Emoji One</family>
|
||||||
|
</prefer>
|
||||||
|
</alias>
|
||||||
|
</fontconfig>
|
||||||
|
|
||||||
@@ -133,8 +133,8 @@ ToolBar {
|
|||||||
keyNavigationWraps: true
|
keyNavigationWraps: true
|
||||||
|
|
||||||
delegate: Control {
|
delegate: Control {
|
||||||
property string displayText: modelData.displayName ?? modelData.unicode
|
readonly property string displayText: modelData.displayName ?? modelData.unicode
|
||||||
property bool isEmoji: modelData.unicode != null
|
readonly property bool isEmoji: modelData.unicode != null
|
||||||
readonly property bool highlighted: autoCompleteListView.currentIndex == index
|
readonly property bool highlighted: autoCompleteListView.currentIndex == index
|
||||||
|
|
||||||
padding: Kirigami.Units.smallSpacing
|
padding: Kirigami.Units.smallSpacing
|
||||||
@@ -176,7 +176,7 @@ ToolBar {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
autoCompleteListView.currentIndex = index
|
autoCompleteListView.currentIndex = index
|
||||||
documentHandler.replaceAutoComplete(displayText)
|
inputField.autoComplete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,8 @@ ToolBar {
|
|||||||
|
|
||||||
Keys.onReturnPressed: {
|
Keys.onReturnPressed: {
|
||||||
if (isAutoCompleting) {
|
if (isAutoCompleting) {
|
||||||
documentHandler.replaceAutoComplete(autoCompleteListView.currentItem.displayText)
|
inputField.autoComplete();
|
||||||
|
|
||||||
isAutoCompleting = false;
|
isAutoCompleting = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -397,7 +398,7 @@ ToolBar {
|
|||||||
autoAppeared = false;
|
autoAppeared = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
documentHandler.replaceAutoComplete(autoCompleteListView.currentItem.displayText)
|
inputField.autoComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
@@ -434,10 +435,22 @@ ToolBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function postMessage() {
|
function postMessage() {
|
||||||
documentHandler.postMessage(inputField.text, attachmentPath, replyEventID);
|
// Qt wraps lines so we need to use a small hack
|
||||||
|
// to remove the wrapped lines but not break the empty
|
||||||
|
// lines.
|
||||||
|
const updatedText = inputField.text.trim()
|
||||||
|
.replace(/@([^: ]*):([^ ]*\.[^ ]*)/, "[@$1:$2](https://matrix.to/#/@$1:$2)");
|
||||||
|
documentHandler.postMessage(updatedText, attachmentPath, replyEventID);
|
||||||
clearAttachment();
|
clearAttachment();
|
||||||
currentRoom.markAllMessagesAsRead();
|
currentRoom.markAllMessagesAsRead();
|
||||||
clear();
|
clear();
|
||||||
|
text = Qt.binding(function() {
|
||||||
|
return currentRoom != null ? currentRoom.cachedInput : "";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function autoComplete() {
|
||||||
|
documentHandler.replaceAutoComplete(autoCompleteListView.currentItem.displayText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ RowLayout {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {"room": currentRoom, "user": author.object, "displayName": author.displayName, "avatarMediaId": author.avatarMediaId, "avatarUrl": author.avatarUrl}).open()
|
onClicked: userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {"room": currentRoom, "user": author.object, "displayName": author.displayName, "avatarMediaId": author.avatarMediaId, "avatarUrl": author.avatarUrl}).open()
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ Kirigami.OverlaySheet {
|
|||||||
enabled: canChangeName
|
enabled: canChangeName
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextArea {
|
||||||
id: roomTopicField
|
id: roomTopicField
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: room.topic
|
text: room.topic
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ Kirigami.OverlaySheet {
|
|||||||
topPadding: 0
|
topPadding: 0
|
||||||
|
|
||||||
header: Kirigami.Heading {
|
header: Kirigami.Heading {
|
||||||
|
id: heading
|
||||||
text: i18nc("Account detail dialog", "Account detail - %1", displayName)
|
text: i18nc("Account detail dialog", "Account detail - %1", displayName)
|
||||||
|
elide: Text.ElideRight
|
||||||
|
QQC2.ToolTip.visible: truncated && hovered
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
|
|||||||
@@ -55,6 +55,18 @@ Kirigami.OverlaySheet {
|
|||||||
text: message
|
text: message
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
onLinkActivated: {
|
||||||
|
if (link.startsWith("https://matrix.to/")) {
|
||||||
|
var result = link.replace(/\?.*/, "").match("https://matrix.to/#/(!.*:.*)/(\\$.*:.*)")
|
||||||
|
if (!result || result.length < 3) return
|
||||||
|
if (result[1] != currentRoom.id) return
|
||||||
|
if (!result[2]) return
|
||||||
|
goToEvent(result[2])
|
||||||
|
} else {
|
||||||
|
Qt.openUrlExternally(link)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import org.kde.kirigami 2.13 as Kirigami
|
|||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
import NeoChat.Component 1.0
|
import NeoChat.Component 1.0
|
||||||
import NeoChat.Effect 1.0
|
|
||||||
import NeoChat.Setting 1.0
|
import NeoChat.Setting 1.0
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
|
|||||||
@@ -35,23 +35,26 @@ Kirigami.ScrollablePage {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.maximumWidth: implicitWidth + 1 // The +1 is to make sure we do not trigger eliding at max width
|
Layout.maximumWidth: implicitWidth + 1 // The +1 is to make sure we do not trigger eliding at max width
|
||||||
Layout.minimumWidth: 0
|
Layout.minimumWidth: 0
|
||||||
|
spacing: Kirigami.Units.gridUnit * 0.8
|
||||||
Kirigami.Heading {
|
Kirigami.Heading {
|
||||||
level: 1
|
id: titleLabel
|
||||||
|
level: 2
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: page.title
|
text: page.title
|
||||||
opacity: page.isCurrentPage ? 1 : 0.4
|
opacity: page.isCurrentPage ? 1 : 0.4
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.leftMargin: Kirigami.Units.largeSpacing
|
|
||||||
Layout.alignment: Qt.AlignBottom
|
|
||||||
}
|
}
|
||||||
QQC2.Label {
|
QQC2.Label {
|
||||||
Layout.alignment: Qt.AlignBottom
|
|
||||||
text: currentRoom.topic
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
maximumLineCount: 1
|
Layout.alignment: Qt.AlignVCenter
|
||||||
//wrapMode: Text.WordWrap
|
anchors.baseline: lineCount < 2 ? titleLabel.baseline : undefined // necessary, since there is no way to do this with Layout.alignment
|
||||||
|
text: currentRoom.topic
|
||||||
|
maximumLineCount: 2
|
||||||
|
wrapMode: Text.Wrap
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
color: Kirigami.Theme.disabledTextColor
|
color: Kirigami.Theme.disabledTextColor
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * 0.9
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,6 +124,14 @@ Kirigami.ScrollablePage {
|
|||||||
room: currentRoom
|
room: currentRoom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Kirigami.PlaceholderMessage {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: messageListView.count === 0 && !currentRoom.allHistoryLoaded
|
||||||
|
QQC2.BusyIndicator {
|
||||||
|
running: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QQC2.Popup {
|
QQC2.Popup {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import QtQuick.Layouts 1.12
|
|||||||
import org.kde.kirigami 2.14 as Kirigami
|
import org.kde.kirigami 2.14 as Kirigami
|
||||||
|
|
||||||
import NeoChat.Component 1.0
|
import NeoChat.Component 1.0
|
||||||
import NeoChat.Effect 1.0
|
|
||||||
import NeoChat.Setting 1.0
|
import NeoChat.Setting 1.0
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[Global]
|
[Global]
|
||||||
IconName=neochat
|
IconName=org.kde.neochat
|
||||||
Name=Neochat
|
Name=Neochat
|
||||||
Name[ca]=Neochat
|
Name[ca]=Neochat
|
||||||
Name[ca@valencia]=Neochat
|
Name[ca@valencia]=Neochat
|
||||||
|
|||||||
@@ -52,6 +52,6 @@ Comment[uk]=Клієнт протоколу Matrix
|
|||||||
Comment[x-test]=xxClient for the Matrix protocolxx
|
Comment[x-test]=xxClient for the Matrix protocolxx
|
||||||
Exec=neochat
|
Exec=neochat
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Icon=neochat
|
Icon=org.kde.neochat
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Network;InstantMessaging;
|
Categories=Network;InstantMessaging;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
15
qml/main.qml
15
qml/main.qml
@@ -41,6 +41,7 @@ Kirigami.ApplicationWindow {
|
|||||||
property alias pageStack: root.pageStack
|
property alias pageStack: root.pageStack
|
||||||
property bool invitationOpen: false
|
property bool invitationOpen: false
|
||||||
property var roomList: null
|
property var roomList: null
|
||||||
|
property Item roomItem: null
|
||||||
|
|
||||||
readonly property bool hasOpenRoom: currentRoom !== null
|
readonly property bool hasOpenRoom: currentRoom !== null
|
||||||
|
|
||||||
@@ -51,8 +52,8 @@ Kirigami.ApplicationWindow {
|
|||||||
if (Config.openRoom) {
|
if (Config.openRoom) {
|
||||||
const room = Controller.activeConnection.room(Config.openRoom);
|
const room = Controller.activeConnection.room(Config.openRoom);
|
||||||
currentRoom = room;
|
currentRoom = room;
|
||||||
let item = pageStack.push(roomPage, { 'currentRoom': room, });
|
roomItem = pageStack.push(roomPage, { 'currentRoom': room, });
|
||||||
connectRoomToSignal(item);
|
connectRoomToSignal(roomItem);
|
||||||
} else {
|
} else {
|
||||||
// TODO create welcome page
|
// TODO create welcome page
|
||||||
}
|
}
|
||||||
@@ -61,16 +62,16 @@ Kirigami.ApplicationWindow {
|
|||||||
function enterRoom(room) {
|
function enterRoom(room) {
|
||||||
let item = null;
|
let item = null;
|
||||||
if (currentRoom != null || invitationOpen) {
|
if (currentRoom != null || invitationOpen) {
|
||||||
currentRoom = null;
|
roomItem.currentRoom = room;
|
||||||
item = pageStack.replace(roomPage, { 'currentRoom': room, });
|
pageStack.currentIndex = pageStack.depth - 1;
|
||||||
} else {
|
} else {
|
||||||
item = pageStack.push(roomPage, { 'currentRoom': room, });
|
roomItem = pageStack.push(roomPage, { 'currentRoom': room, });
|
||||||
}
|
}
|
||||||
currentRoom = room;
|
currentRoom = room;
|
||||||
Config.openRoom = room.id;
|
Config.openRoom = room.id;
|
||||||
Config.save();
|
Config.save();
|
||||||
connectRoomToSignal(item);
|
connectRoomToSignal(roomItem);
|
||||||
return item;
|
return roomItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
function openInvitation(room) {
|
function openInvitation(room) {
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR})
|
|||||||
target_link_libraries(neochat PRIVATE Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark)
|
target_link_libraries(neochat PRIVATE Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark)
|
||||||
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
||||||
|
|
||||||
|
if(NEOCHAT_FLATPAK)
|
||||||
|
target_compile_definitions(neochat PRIVATE NEOCHAT_FLATPAK)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (KQuickImageEditor_FOUND)
|
if (KQuickImageEditor_FOUND)
|
||||||
target_compile_definitions(neochat PRIVATE HAS_KQUICKIMAGEEDITOR)
|
target_compile_definitions(neochat PRIVATE HAS_KQUICKIMAGEEDITOR)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ Controller::Controller(QObject *parent)
|
|||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
TrayIcon *trayIcon = new TrayIcon(this);
|
TrayIcon *trayIcon = new TrayIcon(this);
|
||||||
connect(trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
connect(trayIcon, &TrayIcon::showWindow, this, &Controller::showWindow);
|
||||||
trayIcon->setIconSource("neochat");
|
trayIcon->setIconSource("org.kde.neochat");
|
||||||
trayIcon->setIsOnline(true);
|
trayIcon->setIsOnline(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -69,11 +69,19 @@ int main(int argc, char *argv[])
|
|||||||
about.setOrganizationDomain("kde.org");
|
about.setOrganizationDomain("kde.org");
|
||||||
|
|
||||||
KAboutData::setApplicationData(about);
|
KAboutData::setApplicationData(about);
|
||||||
|
QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("org.kde.neochat")));
|
||||||
|
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
KDBusService service(KDBusService::Unique);
|
KDBusService service(KDBusService::Unique);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NEOCHAT_FLATPAK
|
||||||
|
// Copy over the included FontConfig configuration to the
|
||||||
|
// app's config dir:
|
||||||
|
QFile::copy("/app/etc/fonts/conf.d/99-noto-mono-color-emoji.conf",
|
||||||
|
"/var/config/fontconfig/conf.d/99-noto-mono-color-emoji.conf");
|
||||||
|
#endif
|
||||||
|
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
auto config = NeoChatConfig::self();
|
auto config = NeoChatConfig::self();
|
||||||
|
|
||||||
|
|||||||
@@ -467,6 +467,8 @@ QString NeoChatRoom::markdownToHTML(const QString &markdown)
|
|||||||
|
|
||||||
auto result = QString::fromStdString(html).trimmed();
|
auto result = QString::fromStdString(html).trimmed();
|
||||||
|
|
||||||
|
result.replace("<!-- raw HTML omitted -->", "<br />");
|
||||||
|
result.replace(QRegularExpression("(<br />)*$"), "");
|
||||||
result.replace("<p>", "");
|
result.replace("<p>", "");
|
||||||
result.replace("</p>", "");
|
result.replace("</p>", "");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user