Skip to content

Conversation

@MoshiKoi
Copy link
Member

Should fix #435. However, I haven't fully tested this yet, so feedback is welcome.

@MoshiKoi MoshiKoi marked this pull request as ready for review September 3, 2022 07:32
@MoshiKoi
Copy link
Member Author

MoshiKoi commented Sep 3, 2022

It's been mostly tested and seems to work fine, so I'm opening it for review.

@MoshiKoi MoshiKoi force-pushed the mathjax-markdown-escape branch from cdbf501 to 844a58e Compare September 3, 2022 07:43
@MoshiKoi MoshiKoi force-pushed the mathjax-markdown-escape branch from 844a58e to 4162412 Compare September 3, 2022 07:46
@MoshiKoi
Copy link
Member Author

MoshiKoi commented Sep 3, 2022

Okay, after fixing the most stupid mistake ever (return failure if validate is true), I have actually gotten all of my test posts rendering correctly.

Copy link
Contributor

@Taeir Taeir left a comment

Choose a reason for hiding this comment

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

I learned a lot of new regex things reviewing this PR 😂
Reluctant matching and how [^] works in Javascript regex.

I'm a bit curious though why the "sticky" flag (/y) is set on the regexes and what the effect of that is on your regex. Does that ensure it doesn't match inside of another match?

@MoshiKoi
Copy link
Member Author

MoshiKoi commented Sep 5, 2022

@Taeir

I'm a bit curious though why the "sticky" flag (/y) is set on the regexes and what the effect of that is on your regex. Does that ensure it doesn't match inside of another match?

The y flag indicates that the regex attempts to match the target string only from the index indicated by the lastIndex property (and unlike a global regex, does not attempt to match from any later indexes).

(MDN)

@ArtOfCode- ArtOfCode- merged commit d925640 into codidact:develop Sep 7, 2022
@MoshiKoi MoshiKoi deleted the mathjax-markdown-escape branch September 8, 2022 02: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.

Can we prevent collisions between Markdown and Mathjax?

3 participants