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 regex to support comment inside string like http://example.com #136

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

Conversation

fabricematrat
Copy link

Hi,

To be able to support 'http://example.com' inside the template, cram should avoid to take it as a comment.
The current behavior of cram will create an invalid file with 'http: and then the next line.
I implemented a regexp which replace the string containing comments (// or /.../) by a temp variable and store it in an array. Then call the same logic of removing comment, then put back the original string.

BR,
Fabrice.

@briancavalier
Copy link
Member

Thanks, @fabricematrat. I'll have a look at this soon. Hopefully @unscriptable can take a look, too, since he did a lot of the more recent work on the builder.

@briancavalier
Copy link
Member

This is looking pretty good to me. I love that you separated out part of the parsing so it is testable. Any concerns, @unscriptable?

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