瀏覽代碼

fix: allow # in links when pasting (#2110)

Closes: #1871
Mathias Mogensen 2 年之前
父節點
當前提交
c73b7d1184

+ 1 - 1
frontend/appflowy_flutter/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart

@@ -232,7 +232,7 @@ void _pasteSingleLine(
 /// parse url from the line text
 /// reference: https://stackoverflow.com/questions/59444837/flutter-dart-regex-to-extract-urls-from-a-string
 Delta _lineContentToDelta(String lineContent) {
-  final exp = RegExp(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+');
+  final exp = RegExp(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\#\w/\-?=%.]+');
   final Iterable<RegExpMatch> matches = exp.allMatches(lineContent);
 
   final delta = Delta();