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

Escaping double quotes #30

Open
jsonmaur opened this issue Jun 30, 2017 · 3 comments
Open

Escaping double quotes #30

jsonmaur opened this issue Jun 30, 2017 · 3 comments

Comments

@jsonmaur
Copy link

It breaks the formatting when escaping double quotes in a string, and the string has a "/*" in it. The resource I'm running into the formatting problem with is a CloudWatch metric filter:

resource "aws_cloudwatch_log_metric_filter" "metric-name" {
  name = "MetricName"
  pattern = "{ $.key = \"value/*\" }"
  log_group_name = "${aws_cloudwatch_log_group.main.name}"
  metric_transformation {
    name = "metricName"
    namespace = "metricNamespace"
    value = 1
  }
}

Looks like it may be a bigger formatting problem with HCL, since the GitHub markdown syntax highlighting has the same problem. Nevertheless, this is a valid metric filter pattern for AWS. And if you try to escape the * to fix the formatting, you get the error illegal char escape from Terraform.

@eedwards-sk
Copy link

eedwards-sk commented Jan 2, 2018

The issue here is that you're using what is recognized as multi-line comment formatting /* comment */

Since there's no ending */ to finish the 'comment', the rest of your text is formatted as multi-line comments.

Maybe a fix would be to only match the multi-line comment syntax if it starts the line?

@software-opal
Copy link

software-opal commented Dec 13, 2019

I don't think that reading is correct:

The rendering of:

"[\"prometheus\"]"

is
Screenshot 2019-12-13 at 1 17 00 PM.

@drmaciej
Copy link

has anyone stumbled upon any workarounds?
I'm seeing the same now - I'm escaping a double quote: "\"", and everything after that is rendered in green, as if it was a string.

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

No branches or pull requests

4 participants