Added cashtag support for statuses

• Added:
- cashtag support for statuses

Ref: e23931b255
This commit is contained in:
mgabdev
2020-10-30 14:01:55 -05:00
parent 9f712198dc
commit 6db1cf421b
6 changed files with 67 additions and 18 deletions

View File

@@ -54,6 +54,10 @@ function hashtagStrategy(contentBlock, callback, contentState) {
findWithRegex(HASHTAG_REGEX, contentBlock, callback)
}
function cashtagStrategy(contentBlock, callback, contentState) {
findWithRegex(CASHTAG_REGEX, contentBlock, callback)
}
function urlStrategy(contentBlock, callback, contentState) {
findWithRegex(urlRegex, contentBlock, callback)
}
@@ -87,6 +91,10 @@ const compositeDecorator = new CompositeDecorator([
strategy: hashtagStrategy,
component: HighlightedSpan,
},
{
strategy: cashtagStrategy,
component: HighlightedSpan,
},
{
strategy: urlStrategy,
component: HighlightedSpan,
@@ -109,6 +117,7 @@ const styleMap = {
const GROUP_HANDLE_REGEX = /\g\/[\w]+/g
const HANDLE_REGEX = /\@[\w]+/g
const HASHTAG_REGEX = /\#[\w\u0590-\u05ff]+/g
const CASHTAG_REGEX = /\$[\w\u0590-\u05ff]+/g
class Composer extends React.PureComponent {