Skip to content

Commit

Permalink
Fix support for \r in newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Apr 2, 2022
1 parent 5765f3f commit a42b79a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "svgtiler",
"description": "Tool for drawing diagrams on a grid, combining grids of SVGs into a big SVG figure",
"version": "2.1.0",
"version": "2.1.1",
"repository": {
"type": "git",
"url": "git+https://github.com/edemaine/svgtiler.git"
Expand Down
5 changes: 4 additions & 1 deletion src/svgtiler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ SVGNS = 'http://www.w3.org/2000/svg'
XLINKNS = 'http://www.w3.org/1999/xlink'

splitIntoLines = (data) ->
data.replace('\r\n', '\n').replace('\r', '\n').split('\n')
data
.replace /\r\n/g, '\n'
.replace /\r/g, '\n'
.split '\n'
whitespace = /[\s\uFEFF\xA0]+/ ## based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

extensionOf = (filename) -> path.extname(filename).toLowerCase()
Expand Down

0 comments on commit a42b79a

Please sign in to comment.