이벤트 전파되는 버그 수정
This commit is contained in:
parent
d5e9fec034
commit
cb915eb4d0
|
@ -5,3 +5,7 @@
|
|||
|
||||
## view source mode
|
||||

|
||||
|
||||
|
||||
## 앞으로 할일
|
||||
- 이미 라이브에서 랜더링된 요소(테이블, 콜아웃 등)에서 해당 링크에 커서가 갔을 경우 편집가능할 수 있게 랜더링 취소하기
|
|
@ -47,6 +47,7 @@ class StatefulDecorationSet {
|
|||
const params = await LinkThumbnailWidgetParams(token.value);
|
||||
if (params != null) {
|
||||
linkEl.innerHTML = params;
|
||||
linkEl.addEventListener("click", (e) => e.stopPropagation());
|
||||
} else {
|
||||
return Decoration.none;
|
||||
}
|
||||
|
@ -94,6 +95,7 @@ function buildViewPlugin(plugin: LinkThumbnailPlugin) {
|
|||
const tokenProps = node.type.prop<string>(tokenClassNodeProp);
|
||||
if (tokenProps && node.name === "url") {
|
||||
const value = view.state.doc.sliceString(from, to);
|
||||
console.log(tokenProps, node, value, view.state);
|
||||
if (value) {
|
||||
targetElements.push({from: from, to: to, value: value});
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ export class PostProcessor {
|
|||
context: MarkdownPostProcessorContext
|
||||
) => {
|
||||
// 링크 변환
|
||||
const linkEls = element.findAll("a.external-link:not(.cm-formatting)");
|
||||
const linkEls:Element[] = element.findAll("a.external-link:not(.cm-formatting)");
|
||||
for (const linkEl of linkEls) {
|
||||
// dataview 클래스를 가진 부모 요소를 확인합니다.
|
||||
if (linkEl.closest(".dataview") !== null) {
|
||||
|
@ -26,6 +26,7 @@ export class PostProcessor {
|
|||
linkEl.innerHTML = params;
|
||||
linkEl.removeClass("external-link");
|
||||
linkEl.addClass("markdown-rendered");
|
||||
linkEl.addEventListener("click", (e) => e.stopPropagation());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -49,7 +49,7 @@ a:has(.openGraphPreview):hover {
|
|||
justify-content: center;
|
||||
gap: 8px;
|
||||
overflow: auto;
|
||||
padding: var(--size-4-4) var(--size-4-2);
|
||||
padding: var(--size-4-3) var(--size-4-2);
|
||||
}
|
||||
.openGraphPreview .se-oglink-info {
|
||||
display: block;
|
||||
|
|
Loading…
Reference in New Issue