Bläddra i källkod

Linkify profile card website properly

Zed 7 år sedan
förälder
incheckning
d8c8b6696a
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      src/parser.nim
  2. 1 1
      src/views/profile.nim

+ 1 - 1
src/parser.nim

@@ -12,7 +12,7 @@ proc parseTimelineProfile*(node: XmlNode): Profile =
     username:  profile.getUsername(pre & "screenname"),
     joinDate:  profile.getDate(pre & "joinDateText"),
     location:  profile.selectText(pre & "locationText").stripText(),
-    website:   profile.selectText(pre & "url").stripText(),
+    website:   profile.selectAttr(pre & "urlText a", "title"),
     bio:       profile.getBio(pre & "bio"),
     userpic:   node.getAvatar(".profile-picture img"),
     verified:  isVerified(profile),

+ 1 - 1
src/views/profile.nim

@@ -35,7 +35,7 @@ proc renderProfileCard*(profile: Profile; prefs: Prefs): VNode =
         tdiv(class="profile-website"):
           span:
             icon "link"
-            linkText(profile.website)
+            verbatim linkifyText(profile.website, prefs)
 
       tdiv(class="profile-joindate"):
         span(title=getJoinDateFull(profile)):