Skip to content

Commit

Permalink
remove auto recognise magnet link.
Browse files Browse the repository at this point in the history
  • Loading branch information
yueeng committed Sep 9, 2015
1 parent 495d684 commit 772e34a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "io.github.yueeng.hacg"
minSdkVersion 14
targetSdkVersion 23
versionCode 10
versionName "1.0.7"
versionCode 11
versionName "1.0.7.1"
multiDexEnabled true
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/scala/io/github/yueeng/hacg/InfoActivity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ class InfoFragment extends Fragment {
(
if (content) using(scala.io.Source.fromInputStream(HAcgApplication.instance.getAssets.open("template.html"))) {
reader => reader.mkString.replace("{{title}}",
_article.title).replace("{{body}}", entry.html()
.replaceAll( """(?<!/|:)\b[a-zA-Z0-9]{40}\b""", """magnet:?xt=urn:btih:$0""")
.replaceAll( """(?<!['"=])magnet:\?xt=urn:btih:\b[a-zA-Z0-9]{40}\b""", """<a href="$0">$0</a>""")
.replaceAll( """\b([a-zA-Z0-9]{8})\b(\s)\b([a-zA-Z0-9]{4})\b""", """<a href="http://pan.baidu.com/s/$1">baidu:$1</a>$2$3"""))
_article.title).replace("{{body}}", entry.html())
// .replaceAll( """(?<!/|:)\b[a-zA-Z0-9]{40}\b""", """magnet:?xt=urn:btih:$0""")
// .replaceAll( """(?<!['"=])magnet:\?xt=urn:btih:\b[a-zA-Z0-9]{40}\b""", """<a href="$0">$0</a>""")
// .replaceAll( """\b([a-zA-Z0-9]{8})\b(\s)\b([a-zA-Z0-9]{4})\b""", """<a href="http://pan.baidu.com/s/$1">baidu:$1</a>$2$3""")
} else null,
if (comment) dom.select("#comments .commentlist>li").map(e => new Comment(e)).toList else null,
dom.select("#comments #comment-nav-below #comments-nav .next").headOption match {
Expand Down

0 comments on commit 772e34a

Please sign in to comment.