Skip to content

Commit 3b5823a

Browse files
authored
Fix Link Clicking (#1027)
1 parent 5fb29c6 commit 3b5823a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

apps/desktop/src/components/editor-area/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ export default function EditorArea({
132132
enhancedContent && "pb-10",
133133
])}
134134
onClick={(e) => {
135-
if (!(e.target instanceof HTMLAnchorElement)) {
135+
const target = e.target as HTMLElement;
136+
if (!target.closest("a[href]")) {
136137
e.stopPropagation();
137138
safelyFocusEditor();
138139
}

crates/buffer/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ fn md_to_html(text: &str) -> Result<String, Error> {
6262
let html = markdown::to_html_with_options(
6363
text,
6464
&markdown::Options {
65-
parse: markdown::ParseOptions::default(),
65+
parse: markdown::ParseOptions {
66+
constructs: markdown::Constructs {
67+
gfm_autolink_literal: true,
68+
..Default::default()
69+
},
70+
..Default::default()
71+
},
6672
compile: markdown::CompileOptions {
6773
allow_dangerous_html: true,
6874
..Default::default()

0 commit comments

Comments
 (0)