markdown: Add macOS lookup support for Markdown preview (#59297)
# Objective
Enable macOS three-finger Look Up / translation for rendered Markdown,
including Markdown Preview when it is the active focused item.
## Solution
- Register a read-only input handler for rendered Markdown when either
the Markdown view itself is focused or Markdown Preview provides the
active focus handle.
- Reuse the existing rendered Markdown text mapping for visible text
extraction, hit testing, and bounds calculation.
- Add UTF-16 range conversion so AppKit lookup requests map correctly
between macOS text ranges and Markdown source ranges, including CJK text
and emoji.
Release Notes:
- Improved Markdown Preview by supporting macOS Look Up / translation
gestures when focused.
---------
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
5299a14401Xiaobo Liu committed on 9/23/2026, 3:58:52 AM· committed by GitHubparentbc6dd34