Skip to content

Commit

Permalink
add platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
zheyxu committed Aug 1, 2024
1 parent be6136d commit 84c6afc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io' show File;

import 'package:http/http.dart' as http;
import 'package:universal_io/io.dart' show Platform;

import './namespace.dart';
import './term.dart';
Expand Down Expand Up @@ -1132,7 +1133,9 @@ class Graph {

// Process the multiline literal as needed.
// Example: Replace line breaks with a special sequence.
String processedLiteral = multilineLiteral.replaceAll('\n', '\\n');

String processedLiteral =
multilineLiteral.replaceAll(Platform.isWindows ? '\r\n' : '\n', ' ');

processedLiteral = processedLiteral.replaceAll('"', '\\"');

Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
logging: ^1.2.0
petitparser: ^6.0.2
uuid: ^4.4.1
universal_io: ^2.2.2

dev_dependencies:
lints: ^2.0.1
Expand Down

0 comments on commit 84c6afc

Please sign in to comment.