Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettyPrint does not preseve the content of quoted string #90

Open
bqcuong opened this issue Apr 6, 2023 · 0 comments
Open

prettyPrint does not preseve the content of quoted string #90

bqcuong opened this issue Apr 6, 2023 · 0 comments

Comments

@bqcuong
Copy link

bqcuong commented Apr 6, 2023

Hi there,

I have a similar problem to #57 with the prettyPrint for the quoted string.
It is about prettyPrint automatically move the parts after token && to a new line even in a quoted string.
The example code is described as below.

Is there any quick workarounds for this issue? I'm really looking forward to it.
Thank you very much!

I am using language-docker-10.4.2.

module Main
  ( main
  ) where

import qualified Data.Either as Either
import qualified Data.Text as T
import qualified Data.Text.IO as T.IO
import qualified Data.Text.Lazy as Lazy
import qualified Language.Docker as Docker
import Prelude (IO, ($))

main :: IO ()
main = T.IO.putStr prettyPrinted
  where
    prettyPrinted = Lazy.toStrict $ Docker.prettyPrint parsed
    parsed = Either.fromRight [] $ Docker.parseText source
    source = T.pack "FROM alpine\nRUN grep -F 'cd dir && ./run.sh ' /opt/Makefile"

It should return

FROM alpine
RUN grep -F 'cd dir && ./run.sh ' /opt/Makefile

However, the actual return is as below, which creates different shell execution result.

FROM alpine
RUN grep -F 'cd dir \
 && ./run.sh ' /opt/Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant