Skip to content

Support Windows Newline Characters #396

@NGaffney

Description

@NGaffney

Currently windows style (CRLF) line endings cause styler to throw an error e.g.

library(styler)                 
                                
style_text("a <- 0\nb <- 1")   
#> a <- 0
#> b <- 1
style_text("a <- 0\r\nb <- 1")
#> Error in parse(text = text, keep.source = TRUE): <text>:1:7: unexpected input
#> 1: a <- 0
#>           ^

This caused issues for me when attempting to use the format provider in atom which uses styler.

P.S. Thanks for a great package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions