Skip to content

Text passed to fillText is not adequately escaped when rendered as javascript #6

Description

@danielrolls

To reproduce:

  1. run the following
#!/usr/bin/env stack
{- stack --resolver lts-11.22 runghc
         --package static-canvas-0.2.0.3
-}
{-# LANGUAGE OverloadedStrings #-}

module Main where

import Graphics.Static

main :: IO ()
main = writeCanvasDoc "out.html" 600 400 $ fillText "some text\\" 150 100
  1. Open out.html in a browser
  2. Open dev tools and you should see an error
  3. Look at the generated javascript. The string 'some text' has no closing quote since it has been escaped.

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