Skip to content

Commit

Permalink
🐛 #567 第一点
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jul 13, 2020
1 parent ca81eb0 commit edfbd62
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ts/sv/processKeydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ export const processKeydown = (vditor: IVditor, event: KeyboardEvent) => {
return true;
} else if (blockquoteLineElement.textContent.trim() !== "") {
// 换行应延续 >
range.insertNode(document.createTextNode("\n>"));
let newMarker = "\n" + markerText;
const liMarkerElement = blockquoteLineElement.querySelector('[data-type="li-marker"]');
if (liMarkerElement) {
newMarker += liMarkerElement.parentElement.getAttribute("data-space") + liMarkerElement.textContent;
if (blockquoteLineElement.querySelector('[data-type="task-marker"]')) {
newMarker += "[ ] ";
}
}
range.insertNode(document.createTextNode(newMarker));
range.collapse(false);
inputEvent(vditor);
event.preventDefault();
Expand Down

0 comments on commit edfbd62

Please sign in to comment.