Skip to content

how to implements using Hashtag and Bold text patterns together? #108

@ameer-taghavi

Description

@ameer-taghavi

i added this pattern to handle hashtags: // #HASHTAG

{
  pattern: /#[^\s!@#$%^&*()=+./,\[{\]};:'"?><،؛؟-]+/gi,
  style: [_linkStyle, linkStyle, boldFont],
  onPress: handleHashtagPress,
}

and added this pattern to handle bold text: // **TEXT TO BOLD**

{
  pattern: /(?:\*\*)([^*]*)(?:\*\*)/,
  style: boldStyle,
  renderText: (matchingString, matches) => matches[1],
},

example: **test bold and #hashtag in text**

when using these together, bold text pattern not works. when change priority of patterns, hashtags not works, how can i use both patterns to support hashtag and bold text?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions