Start and end quotes escape problem

Issue #391 invalid
ZheShang Ma
created an issue

I use snakeyaml to compose the greenplum database gpload yaml file. I need the plain value like this "insert into some_table value",with double quotes. But like attache file show,when the quote in start or tail place,output give me single quote marks. wanted: "insert into some_table",but output '"insert into some_table"',don't need the single quote marks. The test code can copy and run with junit4. Thanks.

Comments (3)

  1. ZheShang Ma reporter

    I mean is
    if ”(double quote) located in start and tail,snakeyaml dump '"' with '(quote) around.
    if " in the middle of string ,snakeyaml don't escape

    HashMap<String,Object> gploadYml4=createMap("Before","\"select * from aa\"");
    console output:
    - Before: '"select * from aa"' // escape the double
    - Before: "select * from aa"

    HashMap<String,Object> gploadYml5=createMap("Before","\"select * from \"bb\" aa\"");
    console output:
    - Before: '"select * from "bb" aa"' //escape the double that located in start and tail,but don't escape in the middle.

  2. Log in to comment