Changeset 13994 in josm for trunk/src


Ignore:
Timestamp:
2018-07-01T16:09:11+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #16447 - Improve detection of changeset hashtags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetCommentModel.java

    r13109 r13994  
    88
    99import org.openstreetmap.josm.gui.util.ChangeNotifier;
     10import org.openstreetmap.josm.tools.Utils;
    1011
    1112/**
     
    4546     */
    4647    public List<String> findHashTags() {
    47         return Arrays.stream(comment.split("\\s")).filter(s -> s.length() >= 2 && s.charAt(0) == '#').collect(Collectors.toList());
     48        return Arrays.stream(comment.split("\\s"))
     49                .map(s -> Utils.strip(s, ",;"))
     50                .filter(s -> s.matches("#[a-zA-Z][a-zA-Z_\\-0-9]+"))
     51                .collect(Collectors.toList());
    4852    }
    4953}
Note: See TracChangeset for help on using the changeset viewer.