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

Support for inline dataview fields #196

Merged
merged 2 commits into from
Nov 17, 2023
Merged

Conversation

Laharah
Copy link
Contributor

@Laharah Laharah commented Jan 31, 2023

Add a collectDataFromInlineDvField.

I was originally going to just add the bracket/paren matching to the original regex, but it got nasty quickly. Anyone who's got good regex-fu is welcome to try it themselves. Either way this code now matches both [inline::style] and (hiddenKey::style) dataview metas.

@tcpsyn
Copy link

tcpsyn commented Apr 6, 2023

Thanks for that.

@solpyro
Copy link

solpyro commented Jun 11, 2023

Looking at the regex here #108 it seems like we could get away with just modifying the original regex in collectDataFromDvField, rather than having to run two near identical searches across the search space.

Had you tried this approach?

-------vvv   Allows for a pipe to start the match, in case of a closely wrapped table

(^| |\t|\|)(\[|\()?\*{0,2}dvTarget\*{0,2}(::[ |\t]*(?<value>[\d\.\/\-\w,@; \t:]*)(\]|\))?)

-----------^^^^^^^^------   Allows for optional [ or ( and closing ) or ]   -----^^^^^^^^

regex101 shows that this search matches everything from my test set at least

@lazyguru
Copy link
Collaborator

lazyguru commented Nov 8, 2023

Hi, I now have write access and have been going through all open PRs to get them merged. This is the last of the "overdue" PRs for processing. I see some comments with feedback on the changes here. Are there any updates to be made here?

@Laharah
Copy link
Contributor Author

Laharah commented Nov 9, 2023

It works as is, but as @solpyro pointed out, it's not very efficient. I'm going to do some testing on his solution in the next couple of days, so I'd consider this PR open until I can take a look.

@Laharah
Copy link
Contributor Author

Laharah commented Nov 9, 2023

Okay, rebased on master, updated the regex, and implemented some tests in the example vault. This PR is ready to go!

@lazyguru
Copy link
Collaborator

I haven't forgotten about this. I just need to run through a bit of testing before merging and publishing. Give me a few more days

@lazyguru lazyguru merged commit e1ffed2 into pyrochlore:master Nov 17, 2023
@lazyguru
Copy link
Collaborator

Thank you for your contribution!

@Laharah Laharah deleted the inlineDv branch November 19, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants