MagicStack/MagicPython

{{ in f-string breaks highlighting

verhovsky opened this issue · 2 comments

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

I see now (#225) that MagicPython is not the place to report highlighting issues on github.

I was told this is in fact the right place for this issue. github-linguist/linguist#5572 (comment)

Edit: nvm github-linguist/linguist#5572 (comment)