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

Work around patterns interpreted by String.prototype.replace #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eush77
Copy link
Contributor

@eush77 eush77 commented Jun 5, 2017

This PR replaces String.prototype.replace with the combination of String.prototype.split and Array.prototype.join to work around patterns such as $& or $$ or $' that are interpreted by String.prototype.replace, leading for example to this:

$ github-markdown-preview <(echo '$&') | tail -3
<article class="markdown-body"><p>{{markdown}}amp;</p>
</article>

This commit replaces the usage of `String.prototype.replace` since it
requires escaping against interpreted patterns such as `$&` or `$$`.
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.

1 participant