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

A VERY rudimentary regex enhancment #78

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

CePeU
Copy link

@CePeU CePeU commented Feb 28, 2024

I tried to implement an enhancement so one string can be replaced before export. I did my changes in javscript directly and it seems to work. I have little experience and no toolchain for Typescript so I hopefully transfered the code correctly.

I tried to implement an enhancement so one string can be replaced before export. I did my changes in javscript directly and it seems to work. I have little experience and no toolchain for Typescript so I hopefully transfered the code correctly.
@CePeU
Copy link
Author

CePeU commented Feb 28, 2024

It seems I have found out how to create a pull request. Anyway this goes thanks for publishing that code. It will help me a lot I think! :)

@bingryan
Copy link
Owner

@CePeU fix ci error plz :)

@bingryan
Copy link
Owner

BTW, Should it be an list? not only one element(RegExString -> ReplacmentString)

@bingryan
Copy link
Owner

title do that replace logic?

@CePeU
Copy link
Author

CePeU commented Mar 4, 2024

BTW, Should it be an list? not only one element(RegExString -> ReplacmentString)

For now only one regex. But yes a list of regex and of strings to adjust would be great. The problem is I have not yet figured out how to set up Typescript fully in my enviroment and how to build this project (I seem to be missings obsidian module). An while I could manage to upgrade it I need to have a working enviroment because I need to experiment and learn a lot to do it right.

@CePeU
Copy link
Author

CePeU commented Mar 13, 2024

I finally figured out how to setup TS and a build environment. The code builds and works in my environment. There are still improvements which can be made like a modal window for the regex, checking for an empty/space regex. Instead of arrays maybe objects would be better for the regex/replace combination. But it works as far as I can tell and I am still learning about TS, JavaScript and Obsidian. Any helpfull comments are appreciated nevertheless.

Oh yes and the next big improvement would be another option to replace the matching regex string with a part of the found string (also defined by a regex).

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.

2 participants