Skip to content

Commit

Permalink
修复找不到formathtml的bug
Browse files Browse the repository at this point in the history
Change-Id: I408495d6fd3c54f2503864f7036834a0c579fa07
  • Loading branch information
0312birdzhang committed Apr 3, 2018
1 parent fd597b9 commit c9ecf04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qml/harbour-sailfishclub.qml
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ ApplicationWindow

Component.onCompleted: {
Main.signalcenter = signalCenter;
// page_size = settings.get_pagesize();
JS.app = appwindow;
}

}
Expand Down
3 changes: 2 additions & 1 deletion qml/js/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.pragma library

var py;
var app;
// login function
function login(uid, token, username, password){
if(uid && token){
Expand All @@ -13,7 +14,7 @@ function login(uid, token, username, password){

function splitContent(topic_content, parent) {
var model = Qt.createQmlObject('import QtQuick 2.0; ListModel {}', parent);
topic_content = formathtml(topic_content);
topic_content = app.formathtml(topic_content);
topic_content = topic_content.replace(/<a[^<>]*href=\"([^<>"]*)\"\s+rel=\"nofollow\"><img\s+src=\"([^<>"]*)\".*?a>/g,"<img src=\"$2\" />"); //去掉图片上的超链接
topic_content = topic_content.replace(/<img[^<>]*class=\"[^<>]*emoji-emoji-one[^<>]*\"[^<>]*alt=\"([^<>"]*)\"[^<>]*\/>/g,"$1"); // emoji 直接用图片alt中的
var img_model = [];
Expand Down

0 comments on commit c9ecf04

Please sign in to comment.