Skip to content

Commit

Permalink
Fixed hashtag retrieval issue on carriage return
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoiosue committed Mar 8, 2016
1 parent f8fc249 commit bd0ece2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
MIN_SDK=14
TARGET_SDK=23
VERSION_NAME=5.2.6
VERSION_CODE=208
VERSION_CODE=209
PACKAGE=it.feio.android.omninotes
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static List<Tag> getAllTags() {

public static HashMap<String, Integer> retrieveTags(Note note) {
HashMap<String, Integer> tagsMap = new HashMap<>();
for (String token : (note.getTitle() + " " + note.getContent()).replaceAll("\n", "").trim().split(" ")) {
for (String token : (note.getTitle() + " " + note.getContent()).replaceAll("\n", " ").trim().split(" ")) {
if (RegexPatternsConstants.HASH_TAG.matcher(token).matches()) {
int count = tagsMap.get(token) == null ? 0 : tagsMap.get(token);
tagsMap.put(token, ++count);
Expand Down

0 comments on commit bd0ece2

Please sign in to comment.