Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
34f58c85
Commit
34f58c85
authored
Oct 16, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for LinkVisitor
parent
dc6f9936
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
MessageParser.kt
...src/main/java/chat/rocket/android/helper/MessageParser.kt
+11
-0
No files found.
app/src/main/java/chat/rocket/android/helper/MessageParser.kt
View file @
34f58c85
...
...
@@ -223,7 +223,16 @@ class MessageParser @Inject constructor(
class
LinkVisitor
(
private
val
builder
:
SpannableBuilder
)
:
AbstractVisitor
()
{
var
parsed
=
false
override
fun
visit
(
text
:
Text
)
{
// XXX - Gambiarra ahead.
// This visitor visitis the text line by line, but we process all the document.
// So we don't parse again if it visited at least one line.
if
(
parsed
)
{
return
}
// Replace all url links to markdown url syntax.
val
matcher
=
PatternsCompat
.
AUTOLINK_WEB_URL
.
matcher
(
builder
.
text
())
val
consumed
=
mutableListOf
<
String
>()
...
...
@@ -240,6 +249,8 @@ class MessageParser @Inject constructor(
consumed
.
add
(
link
)
}
}
parsed
=
true
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment