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

Add function to remove all Discord formatting text from string #4

Open
1 task done
zunda-arrow opened this issue Aug 26, 2022 · 0 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@zunda-arrow
Copy link
Collaborator

Summary

Title
Name ideas include toolbox.clean and toolbox.remove_markdown.

Why is this needed?

I honestly have no idea.

Ideal implementation

A lot of regex

Checklist

  • I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.
@zunda-arrow zunda-arrow added the enhancement New feature or request label Aug 26, 2022
hypergonial added a commit that referenced this issue Feb 12, 2023
* Added regex and function with docstring

* changed parameter to str

* Created tests for strikethrough

* Added Strikethrough regex and function

* more tests

* renamed to test_remove_markdown

* added test_remove_block

* added remove_block function, split regex up

* added test_remove_multiblock

* added remove_multiblock function

* added test_remove_bold, renamed formats

* added remove_bold and enum, renamed formats

* added remove_underline

* added test_remove_underline

* added test_remove_italic (for underscores)

* added remove_italic (for _), changed re.sub method

* added test_remove_italic_asterisk

* added remove_italic_asterisk

* added test_remove_quote/multi_quote/spoiler

* added remove_quote/multi_quote/spoiler

* cleaned up tests

* moved methods to remove_markdown.py

* method pluralisation, changes to docstrings

* adjusted method names

* formatting

* add enums to parameter

* moved to strings.py

* add remove_markdown.py

* changed imports to toolbox.strings

* add .ALL enum into function

* add .ALL tests

* removed subfunctions, build general function

* removed subtest, added general tests

* deleted None test

* deleted None statement

* deleted prints in remove_markdown

* fixed typo

* adjusted for loop

* add license info

* cleaned up function

* changed dict values to tuples

* add re.compile to dict, yeet 1 line from loop

* add docstrings to enum

* changed dict to constant and moved to top

* cleaning up comments and docstrings

* _ is no more

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* Update toolbox/strings.py

Co-authored-by: Hyper <[email protected]>

* change patterns to greedy

* fix pattern

* move test cases into dict

* formatting

* add helper function to remove quotes

* more tests

* L mypy

* change remove_quote and fix doctstrings

* tests for ignoring matches inside codeblocks

* formatting

* ignore formatting inside codeblocks, rewrite

* mark remove_quote as internal

Co-authored-by: Hyper <[email protected]>

* mark remove_quote as internal

Co-authored-by: Hyper <[email protected]>

* update docstring

---------

Co-authored-by: Hyper <[email protected]>
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

1 participant