-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple characters trigger string #38
Comments
Agreed - this would be a very useful feature! |
Thanks for your feedback! |
thanks for the quick response :) The r/ p/ triggers would be similar to subreddits. I think if we allow for the flexibility to enable more than single character triggers, it would make building |
Got it. I'll think about how to implement it soon. One more question. There can be cases only with one or two characters ( Will it work for you to add the ability to provide a custom regex and callbacks for extracting the required parts from it ( |
For me personally 2 characters is enough. Regex works for me as well! I can see how regex can be useful for other people but I can say for sure |
@dabakovich btw would love to donate or support the library somehow since we are using it pretty heavily, how can we reach you? |
Add POC for the feature. Just new working 'pattern' and 'parsePattern' props. If we have 'pattern', we should have also 'parsePattern' to getting 'MentionData' object. Work for now with 'trigger[name](id)' mention value yet. #38
@terryli0095 just published alpha v2.3.0-0 with POC of providing custom regex. For now, working only with regexes like {
trigger: 'r/',
allowedSpacesCount: 0,
renderSuggestions: renderCustomTriggerSuggestions,
textStyle: {fontWeight: 'bold', color: 'red'},
pattern: /((r\/)\[([^[]*)]\(([^(^)]*)\))/gi,
parsePattern: ([, original, trigger, name, id]) => ({original, trigger, name, id}),
}, Also added a "Support Me" category at the bottom of the library's home page :) |
Cool will test this and support ASAP!! Thank you for this :) |
Hi @dabakovich I seem to be getting an error trying to pay with paypal and I believe @terryli0095 has the same issue. Is there another way we could contribute? |
Thanks, @andywong418! I see the problem and will try to fix it soon. |
@andywong418 PayPal payment should work now. |
@terryli0095 Did you test v2.3.0-0 version? Is the update works for you? |
hey @dabakovich, bumped into this issue, I think it might be a base of what I'm also trying to solve, I'm not sure if I read the comments correctly, but I'm looking to achieve a markdown similar to [EDIT] |
@dabakovich @t1amat9409 @andywong418 I have just created a pull request to insert the feature of allowing consumers of the library to specify a custom transformation for the mention value. Please check it here: #52 I am open to suggestions on it. |
… pattern Wrap trigger in regex with {}, so we can now use multiple characters. Add support for custom trigger pattern. BREAKING CHANGES New renames: `PartType` -> `Config` `isTriggerPartType` -> `isTriggerConfig` `getMentionValue` -> `getTriggerValue` `replaceMentionValues` -> `replaceTriggerValues` Change default trigger regex and mention value from `@[David Tabaka](123)` to `{@}[David Tabaka](123)`. Useful for #38, #51, #52, #80.
Hi all. I'm glad to say that v3 release is coming with few core improvements. One of the new features is full support of multiple characters trigger and custom regex pattern for mentions. You can find examples of using new v3 release here: https://github.com/dabakovich/react-native-controlled-mentions/blob/3.0/example/mentions-functional-component.tsx To test
|
Would it be possible/are there plans to support multiple character triggers? We have a use case for r/, p/ etc. Or would it be possible to point me to the relevant code?
The text was updated successfully, but these errors were encountered: