danylovolokh / HashTagHelper

This is a library designed for highlighting hashtags ("#example") and catching click on them.
592 stars 71 forks source link

Disable hashtag detection if length of tag is 1 #19

Open ibrahimbroachwala opened 6 years ago

ibrahimbroachwala commented 6 years ago

Is there any way I can disable the hashtag detection if it is just a single letter or number. For eg: #a #2 should not be detected as hashtags.

tamirherman commented 5 years ago

In "setColorsToAllHashTags" function, add "if(nextNotLetterDigitCharIndex - startIndexOfNextHashSign >= MIN_CHARS_FOR_HASHTAG)" before "setColorForHashTagToTheEnd", where MIN_CHARS_FOR_HASHTAG is 3.