Skip to content

{{ in f-string breaks highlighting #239

Closed
@verhovsky

Description

@verhovsky

I don't know if the {{ is what does it, but that's what I suspect. {{ is how you escape a "{" so that your string can contain a literal "{".

  • Editor name and version: Github
  • Platform: Web
  • Color scheme: Github default color scheme
  • MagicPython version: 2802ded
  • A sreenshot:

Screen Shot 2021-09-19 at 11 26 04 AM

  • 5-10 lines of surrounding code:
def format_as_js(d, var_name, indent=0, indent_type='\t'):
    yield f"{indent_type * indent}var {var_name} = {{"
    for top_key, opt in d.items():
        def quote(key):
            return key if key.isalpha() else repr(key)

rest of the code is here: https://github.com/verhovsky/curlconverter/blob/869c6d0229a9004bdca8e44d1ef3c3227e785093/extract_curl_args.py#L201

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions