Elm-format: \xADf should not format to \x0ADF

Created on 22 Feb 2018  路  3Comments  路  Source: avh4/elm-format

Inserting a soft hyphen using \xAD in front of the letter f will format format it to \x0ADF, e.g., "\xADfoobar" would turn into "\x0ADFoobar", effectively inserting a new unicode character and dropping the f from whatever word was used.

bug duplicate

All 3 comments

Duplicate of #412

Elm 0.19 will escape characters different, so the code will now be "\u{00AD}foobar", which will no longer be parsed incorrectly when formatted.

A workaround for Elm 0.18 and earlier is to change the code to "\xAD" + "foobar", which will format correctly.

This is fixed in master for Elm 0.19. This isn't going to be fixed for Elm 0.18 and earlier, as it's an invasive fix and isn't necessary in Elm 0.19 and beyond. (For Elm 0.18 and earlier, see the workaround mentioned here: https://github.com/avh4/elm-format/issues/462#issuecomment-390455947)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pdamoc picture pdamoc  路  8Comments

sporto picture sporto  路  7Comments

rtfeldman picture rtfeldman  路  5Comments

yonigibbs picture yonigibbs  路  7Comments

gabrielflorit picture gabrielflorit  路  7Comments