From a9ac1c4bb8c28bd15d767006082098715122430b Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Fri, 17 Feb 2017 10:31:24 -0800 Subject: [PATCH] adjusted parser to handle < and > to address issue #18 and even added a little love <3 --- assets/.assets.index | 4 ++-- assets/ProfilePage.qml | 3 ++- assets/parser.js | 5 +++-- translations/Goober.ts | 26 +++++++++++++------------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/assets/.assets.index b/assets/.assets.index index b5fa242..564fe2e 100644 --- a/assets/.assets.index +++ b/assets/.assets.index @@ -1,12 +1,10 @@ 1 47 -AboutPage.qml AppCover.qml LoginSheet.qml main.qml moment.js NewPostSheet.qml -PostItem.qml ProfilePage.qml RefreshItem.qml SettingsPage.qml @@ -44,6 +42,8 @@ icons/retweet.png icons/sign-out.png icons/star-o.png icons/star.png +PostItem.qml StreamTab.qml WebViewSheet.qml parser.js +AboutPage.qml diff --git a/assets/ProfilePage.qml b/assets/ProfilePage.qml index 55466d2..0f831c0 100644 --- a/assets/ProfilePage.qml +++ b/assets/ProfilePage.qml @@ -19,6 +19,7 @@ import bb.cascades 1.4 import org.labsquare 1.0 +import "parser.js" as Parser Page { @@ -109,7 +110,7 @@ Page { preferredWidth: ui.du(45) Label { //text: lorem - text: user.content.html + text: Parser.parsePostData(user.content.html) multiline: true textFormat: TextFormat.Html } diff --git a/assets/parser.js b/assets/parser.js index a4e8c07..2b5202f 100644 --- a/assets/parser.js +++ b/assets/parser.js @@ -236,8 +236,9 @@ function parsePostData(t) { t = t.replace(/þ/g,"\u00FE"); t = t.replace(/ÿ/g,"\u00FF"); t = t.replace(/"/g,"\u0022"); - t = t.replace(/</g,"\u003C"); - t = t.replace(/>/g,"\u003E"); + t = t.replace(/<3/g, "\u2764"); + t = t.replace(/</g,"\u02C2"); + t = t.replace(/>/g,"\u02C3"); t = t.replace(/€/g,"\u0080"); t = t.replace(/‚/g,"\u0082"); t = t.replace(/ƒ/g,"\u0083"); diff --git a/translations/Goober.ts b/translations/Goober.ts index 1e1cfda..4e6cc43 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -78,55 +78,55 @@ ProfilePage - - + + Following - - + + Followers - - + + Posts - + Bookmarks - + Unfollow - + Follow - + Unmute - + Mute - + Unblock - + Block