Skip to content

Commit f7bdba0

Browse files
authored
fix: fix Copy Paste on Web (#33)
1 parent 5239a46 commit f7bdba0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/infra/clipboard.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:io' show Platform;
22

3+
import 'package:flutter/foundation.dart';
34
import 'package:rich_clipboard/rich_clipboard.dart';
45

56
class AppFlowyClipboardData {
@@ -19,7 +20,7 @@ class AppFlowyClipboard {
1920
// https://github.com/BringingFire/rich_clipboard/issues/13
2021
// Wrapping a `<html><body>` tag for html in Windows,
2122
// otherwise it will raise an exception
22-
if (Platform.isWindows && html != null) {
23+
if (!kIsWeb && Platform.isWindows && html != null) {
2324
if (!html.startsWith('<html><body>')) {
2425
html = '<html><body>$html</body></html>';
2526
}
@@ -40,7 +41,7 @@ class AppFlowyClipboard {
4041

4142
// https://github.com/BringingFire/rich_clipboard/issues/13
4243
// Remove all the fragment symbol in Windows.
43-
if (Platform.isWindows && html != null) {
44+
if (!kIsWeb && Platform.isWindows && html != null) {
4445
html = html
4546
.replaceAll('<!--StartFragment-->', '')
4647
.replaceAll('<!--EndFragment-->', '');

0 commit comments

Comments
 (0)