Refactor markdown editor and use it for milestone description editor (#32688)

Refactor markdown editor to clarify its "preview" behavior and remove
jQuery code.

Close #15045

---------

Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
wxiaoguangandsilverwind authored and GitHub committed 2024-12-04 02:11:34 +00:00
1 parent 2f43536c3e
commit c9e582c6b6
29 files changed
+147 -116

No files matched your search

+3 -5
View File
@@ -201,10 +201,8 @@ export function initRepoEditor() {
})();
}
export function renderPreviewPanelContent($previewPanel, data) {
$previewPanel.html(data);
export function renderPreviewPanelContent(previewPanel: Element, content: string) {
previewPanel.innerHTML = content;
initMarkupContent();
const $refIssues = $previewPanel.find('p .ref-issue');
attachRefIssueContextPopup($refIssues);
attachRefIssueContextPopup(previewPanel.querySelectorAll('p .ref-issue'));
}