Skip to content

fix: backtick processing #83

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

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

daeMOn63
Copy link

The current source generation produces hex encoded backticks, resulting in invalid code.

There seems to be no way to properly encode or escape them, as the final code is itself part of a backticked multi-lines string.

Go does not allow nesting or escaping backticks. There's some proposals to address this issue:

but look like nothing got accepted there yet.

The current sources have been updated to use string concatenation instead of backticks, and the generator got updated to panic if it encounter any.

This is not an ideal solution, as some sources may require the usage of backticks at some point, but it would probably require a deeper rework of the generation to fix it (maybe external files + go:embed ?)

The current source generation produces hex encoded backticks, resulting in
invalid code.

There seems to be no way to properly encode or escape them, as the final code is
itself part of a backticked multi-lines string.

Go does not allow nesting or escaping backticks. There's some proposals to address this issue:
- golang/go#32190
- golang/go#32590

but look like nothing got accepted there yet.

The current sources have been updated to use string concatenation
instead of backticks, and the generator got updated to panic if it
encounter any.

This is not an ideal solution, as some sources may require the usage of
backticks at some point, but it would probably require a deeper rework
of the generation to fix it (maybe external files + go:embed ?)
@daeMOn63
Copy link
Author

cc @CollierCZ following up from platformsh/platformsh-docs#2796

Copy link
Contributor

@CollierCZ CollierCZ left a comment

Choose a reason for hiding this comment

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

Thanks so much for the fixes!

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