Skip to content
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

Nested or Overlapped MatchText #9

Open
Addictorator opened this issue Oct 19, 2019 · 5 comments
Open

Nested or Overlapped MatchText #9

Addictorator opened this issue Oct 19, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@Addictorator
Copy link

Addictorator commented Oct 19, 2019

As it is now, it seems I'm unable to nest multiple matchtext without specifically writing a regex pattern to match for the amalgamation of the two. Let's say I have italics and I check for it with "(i) Test (i)" (test), and bold with "(b) Test (b)" (test) . A combination of the two simply seems to match the outer set and ignore anything within. A bold and italicized text writted as "(b) (i) Test (i) (b) " simply parses as "(i) Test (i)" in bold.

That's straightforward nesting, disregarding partial overlapping such as "(i) This is (b) a test (i) to check (b)" But this is likely far more complicated to do.

I understand allowing for applying multiple text matching to a single portion of text might conflict with multiple text styles, but why not have a list of parsed with the order of parsing, overwriting the previous one matched, in case of any conflicting parameters, the same for the onTap() function. Is this a feasible request? Thanks!

@Addictorator Addictorator changed the title Nested or Overlapping MatchText Nested or Overlapped MatchText Oct 19, 2019
@fayeed
Copy link
Owner

fayeed commented Oct 19, 2019

The behavior you are observing is intentional, Initial this package used to override the previously parsed text, lets say you have this https://apps.apple.com/id/app/facebook/id284882215 If you passed Email & Phone as MatchText this would get parsed as https://apps.apple.com/id/app/facebook/id and this end part 284882215 would be parsed as Phone so I changed how the package works.

So now whenever a match is found it is padded with %%%% so in your case (b) (i) Test (i) (b) this would become %%%%(b) (i) Test (i) (b)%%%% so next time when its run through next MatchText it won't be matched with the regex pattern.

Hope this helps.

@Addictorator
Copy link
Author

Hi, is this in commit 0fad3e7 (v.1.1.2 -> v1.2.0)? Thinking of forking, adding Boolean and sending a merge request. By the way, this package has been really useful in multiple ways, I like how customizable it is. Thanks :)

@fayeed
Copy link
Owner

fayeed commented Oct 20, 2019

Yes, that's the commit. Feel free to make a PR too.

@clragon
Copy link

clragon commented Apr 15, 2020

Is there any update on this?
I love how easy this package is to use,
but I'm trying to parse a custom markdown language and not having nested matching makes things ... hard.

I was thinking maybe we could add a boolean to MatchText that indicates wether or not to match the text multiple times.

@mccol
Copy link

mccol commented May 31, 2020

is it possible to support nested matching?

@fayeed fayeed added the enhancement New feature or request label Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants