adjusted parser to handle < and > to address issue #18 and even added a

little love <3
This commit is contained in:
Morgan McMillian 2017-02-17 10:31:24 -08:00
parent 8144904d1e
commit a9ac1c4bb8
4 changed files with 20 additions and 18 deletions

View file

@ -1,12 +1,10 @@
1 1
47 47
AboutPage.qml
AppCover.qml AppCover.qml
LoginSheet.qml LoginSheet.qml
main.qml main.qml
moment.js moment.js
NewPostSheet.qml NewPostSheet.qml
PostItem.qml
ProfilePage.qml ProfilePage.qml
RefreshItem.qml RefreshItem.qml
SettingsPage.qml SettingsPage.qml
@ -44,6 +42,8 @@ icons/retweet.png
icons/sign-out.png icons/sign-out.png
icons/star-o.png icons/star-o.png
icons/star.png icons/star.png
PostItem.qml
StreamTab.qml StreamTab.qml
WebViewSheet.qml WebViewSheet.qml
parser.js parser.js
AboutPage.qml

View file

@ -19,6 +19,7 @@
import bb.cascades 1.4 import bb.cascades 1.4
import org.labsquare 1.0 import org.labsquare 1.0
import "parser.js" as Parser
Page { Page {
@ -109,7 +110,7 @@ Page {
preferredWidth: ui.du(45) preferredWidth: ui.du(45)
Label { Label {
//text: lorem //text: lorem
text: user.content.html text: Parser.parsePostData(user.content.html)
multiline: true multiline: true
textFormat: TextFormat.Html textFormat: TextFormat.Html
} }

View file

@ -236,8 +236,9 @@ function parsePostData(t) {
t = t.replace(/&#254;/g,"\u00FE"); t = t.replace(/&#254;/g,"\u00FE");
t = t.replace(/&#255;/g,"\u00FF"); t = t.replace(/&#255;/g,"\u00FF");
t = t.replace(/&quot;/g,"\u0022"); t = t.replace(/&quot;/g,"\u0022");
t = t.replace(/&lt;/g,"\u003C"); t = t.replace(/&lt;3/g, "\u2764");
t = t.replace(/&gt;/g,"\u003E"); t = t.replace(/&lt;/g,"\u02C2");
t = t.replace(/&gt;/g,"\u02C3");
t = t.replace(/&euro;/g,"\u0080"); t = t.replace(/&euro;/g,"\u0080");
t = t.replace(/&sbquo;/g,"\u0082"); t = t.replace(/&sbquo;/g,"\u0082");
t = t.replace(/&fnof;/g,"\u0083"); t = t.replace(/&fnof;/g,"\u0083");

View file

@ -78,55 +78,55 @@
<context> <context>
<name>ProfilePage</name> <name>ProfilePage</name>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="127"/> <location filename="../assets/ProfilePage.qml" line="128"/>
<location filename="../assets/ProfilePage.qml" line="200"/> <location filename="../assets/ProfilePage.qml" line="201"/>
<source>Following</source> <source>Following</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="140"/> <location filename="../assets/ProfilePage.qml" line="141"/>
<location filename="../assets/ProfilePage.qml" line="215"/> <location filename="../assets/ProfilePage.qml" line="216"/>
<source>Followers</source> <source>Followers</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="153"/> <location filename="../assets/ProfilePage.qml" line="154"/>
<location filename="../assets/ProfilePage.qml" line="187"/> <location filename="../assets/ProfilePage.qml" line="188"/>
<source>Posts</source> <source>Posts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="166"/> <location filename="../assets/ProfilePage.qml" line="167"/>
<source>Bookmarks</source> <source>Bookmarks</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="232"/> <location filename="../assets/ProfilePage.qml" line="233"/>
<source>Unfollow</source> <source>Unfollow</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="232"/> <location filename="../assets/ProfilePage.qml" line="233"/>
<source>Follow</source> <source>Follow</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="245"/> <location filename="../assets/ProfilePage.qml" line="246"/>
<source>Unmute</source> <source>Unmute</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="245"/> <location filename="../assets/ProfilePage.qml" line="246"/>
<source>Mute</source> <source>Mute</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="258"/> <location filename="../assets/ProfilePage.qml" line="259"/>
<source>Unblock</source> <source>Unblock</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/ProfilePage.qml" line="258"/> <location filename="../assets/ProfilePage.qml" line="259"/>
<source>Block</source> <source>Block</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>