diff --git a/js/ui/fmt.js b/js/ui/fmt.js index f36e2a8..974e182 100644 --- a/js/ui/fmt.js +++ b/js/ui/fmt.js @@ -81,8 +81,8 @@ function fmt_mentions(model, str, tags) { data-thread-id="${ref}">note:${fmt_pubkey(ref)}`; } else if (tag[0] == 'p') { let profile = model_get_profile(model, ref); - buf += ` - ${fmt_name(profile)}`; + buf += `${fmt_name(profile)}`; } } return buf; diff --git a/js/ui/render.js b/js/ui/render.js index e0599e3..a45d373 100644 --- a/js/ui/render.js +++ b/js/ui/render.js @@ -251,7 +251,7 @@ function render_mentioned_name(pk, profile) { function render_name(pk, profile, prefix="") { // Beware of whitespace. return html`${prefix} + action="open-profile" data-pubkey="${pk}"> ${fmt_profile_name(profile, fmt_pubkey(pk))}` } diff --git a/js/ui/state.js b/js/ui/state.js index fe8fec3..f10b139 100644 --- a/js/ui/state.js +++ b/js/ui/state.js @@ -683,6 +683,12 @@ function onclick_toggle_cw(ev) { function onclick_any(ev) { let el = ev.target; + // Check if we have a selection and don't bother with anything + let selection = document.getSelection(); + if (selection && selection.isCollapsed == false && + view_get_timeline_el().contains(selection.anchorNode)) { + return; + } let action = el.getAttribute("action"); if (action == null && el.tagName != "A") { const parent = find_parent(el, "[action]");