v icon indicating copy to clipboard operation
v copied to clipboard

internal_memory:22:626: error: invalid character `\`

Open ralyodio opened this issue 4 years ago • 6 comments

just ran v up and now I get this error:

internal_memory:22:626: error: invalid character \

ralyodio avatar Mar 01 '21 22:03 ralyodio

Do you get that error when you run v up? Are you trying to run a V program?

Please follow the bug template and provide the details necessary for reproduction.

mcastorina avatar Mar 01 '21 23:03 mcastorina

just started happening today. no idea why:

$ v up           
Updating V...
Current V version:
V 0.2.2 2b53992, timestamp: 2021-03-01 21:47:00 +0100
➜  app git:(master) 
$ v run app.v 
internal_memory:22:626: error: invalid character `\`

ralyodio avatar Mar 01 '21 23:03 ralyodio

here is the code: https://ufile.io/ruh47712

ralyodio avatar Mar 01 '21 23:03 ralyodio

Did some debugging and the error is coming from scanner/scanner.v which I traced back to one of your template files:

<title>@{topics.replace('+', ' ')} jobs - @{app.meta_name}</title>

so I think it's a templating bug.

Here's a minimal POC:

app.v

import vweb

struct App { vweb.Context }

pub fn (mut app App) index() vweb.Result {
        x := 'a+b'
        return $vweb.html()
}

index.html

@{x.replace('+', ' ')}

mcastorina avatar Mar 02 '21 01:03 mcastorina

Still an issue.

medvednikov avatar Jul 10 '22 20:07 medvednikov

This works as of V 0.4.4 d912268.

import vweb

struct App { vweb.Context }

pub fn (mut app App) index() vweb.Result {
        x := 'a+b'
        return $vweb.html()
}

fn main() {
	app := App{}
	vweb.run_at(app, vweb.RunParams{
port: 8081
}) or { panic(err) }
}
@{x.replace('+', ' ')}

pierrec avatar Jan 20 '24 08:01 pierrec