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 improved markdown #9361

Merged
merged 1 commit into from Apr 18, 2023
Merged

Conversation

Puncher1
Copy link
Contributor

@Puncher1 Puncher1 commented Apr 15, 2023

Summary

Just a small change to add support for headers # and unordered lists - in the markdown regex.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

Copy link
Owner

@Rapptz Rapptz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This technically works, but it's not particularly correct since # and - (and, by extension numbers such as 1., 2., etc.) are required to be in the beginning of the line (or optionally with spaces) which the regex doesn't deal with.

I'll just deal with it in a future commit.

@Rapptz Rapptz merged commit 50f7b94 into Rapptz:master Apr 18, 2023
8 checks passed
@Puncher1
Copy link
Contributor Author

This technically works, but it's not particularly correct since # and - (and, by extension numbers such as 1., 2., etc.) are required to be in the beginning of the line (or optionally with spaces) which the regex doesn't deal with.

Yeah, but at the moment things like bold texts **Example** are also not handled correctly because this would also be escaped: Example * (see image below), so I just adapted to this for my changes.

image

Accordingly I thought 1., 2. etc. would be excessive because this would be a mess if you use it in the middle of a text, which is quite often the case.

@Puncher1 Puncher1 deleted the improved-markdown branch April 18, 2023 12:11
@Rapptz
Copy link
Owner

Rapptz commented Apr 18, 2023

This is what the as_needed keyword argument is for. It's just hard to consistently do this without accidentally breaking something. For # and - they're actually useless unless they're in the beginning so it's not the same.

For example, consider the very common text you'll encounter such as Danny#0007, this would now be escaped when it wouldn't be necessary.

@Puncher1
Copy link
Contributor Author

This is what the as_needed keyword argument is for. It's just hard to consistently do this without accidentally breaking something. For # and - they're actually useless unless they're in the beginning so it's not the same.

For example, consider the very common text you'll encounter such as Danny#0007, this would now be escaped when it wouldn't be necessary.

Yeah, fair.

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.

None yet

2 participants