Class: Decidim::ContentParsers::HashtagParser
- Inherits:
-
TagParser
- Object
- BaseParser
- TagParser
- Decidim::ContentParsers::HashtagParser
- Defined in:
- decidim-core/lib/decidim/content_parsers/hashtag_parser.rb
Overview
A parser that searches hashtags in content.
A word starting with ‘#` will be considered as a hashtag if it only contains letters, numbers or underscores. If the `#` is followed with an underscore, then it is not considered.
Defined Under Namespace
Classes: Metadata
Constant Summary collapse
- HASHTAG_REGEX =
Matches a hashtag if it starts with a letter or number and only contains letters, numbers or underscores.
/(?:\A|\s\K)\B#([[:alnum:]](?:[[:alnum:]]|_)*)\b/i
Constants inherited from BaseParser
Instance Attribute Summary
Attributes inherited from BaseParser
Instance Method Summary collapse
Methods inherited from TagParser
Methods inherited from BaseParser
Methods included from Decidim::ContentProcessor::Common
#html_content?, #html_fragment
Constructor Details
This class inherits a constructor from Decidim::ContentParsers::BaseParser