liquid-rust icon indicating copy to clipboard operation
liquid-rust copied to clipboard

Crash when parser error on non-ascii content

Open epage opened this issue 4 years ago • 0 comments

static SIMPLE_TEMPLATE_LIQUID: &str = "
<html>
  <head>
    <title>{{ product.name }}</title>
  </head>
  <body>
    <h1>{{ product.name }} - {{ product.manufacturer | upcase }}</h1>
    <p>{{ product.summary }}</p>
    <p>£{{ product.price * 1.20 }} (VAT inc.)</p>
    <p>Look at reviews from your friends {{ username }}</p>
    <button>Buy!</button>
  </body>
</html>
";

Error was from

  • crates/core/src/parser/parser.rs
  • let mut text = String::from(&invalid_token_position.line_of()[..offset_c]); We sliced into the middle of stuff

epage avatar Feb 27 '21 01:02 epage