@@ -734,8 +734,9 @@ function noteApp() {
734734 const notePath = this . draggedNoteForLink ;
735735 const noteName = notePath . split ( '/' ) . pop ( ) . replace ( '.md' , '' ) ;
736736
737- // Create markdown link
738- const link = `[${ noteName } ](${ notePath } )` ;
737+ // Create markdown link (URL-encode the path to handle spaces and special characters)
738+ const encodedPath = notePath . split ( '/' ) . map ( segment => encodeURIComponent ( segment ) ) . join ( '/' ) ;
739+ const link = `[${ noteName } ](${ encodedPath } )` ;
739740
740741 // Insert at cursor position
741742 const textarea = event . target ;
@@ -775,7 +776,8 @@ function noteApp() {
775776 event . preventDefault ( ) ;
776777
777778 // Remove any anchor from the href (e.g., "note.md#section" -> "note.md")
778- const notePath = href . split ( '#' ) [ 0 ] ;
779+ // Also decode URL encoding (e.g., "note%203.md" -> "note 3.md")
780+ const notePath = decodeURIComponent ( href . split ( '#' ) [ 0 ] ) ;
779781
780782 // Skip if it's just an anchor link
781783 if ( ! notePath ) return ;
@@ -2424,11 +2426,11 @@ function noteApp() {
24242426 <meta name="viewport" content="width=device-width, initial-scale=1.0">
24252427 <title>${ noteName } </title>
24262428
2427- <!-- Highlight.js for code syntax highlighting -->
2429+ <!-- Highlight.js for code syntax highlighting (v11.9.0) -->
24282430 ${ highlightTheme ? `<link rel="stylesheet" href="${ highlightTheme } ">` : '<!-- No highlight.js theme detected -->' }
24292431 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
24302432
2431- <!-- MathJax for LaTeX math rendering (same config as preview ) -->
2433+ <!-- MathJax for LaTeX math rendering (v3.2.2 ) -->
24322434 <script>
24332435 MathJax = {
24342436 tex: {
@@ -2452,11 +2454,11 @@ function noteApp() {
24522454 }
24532455 };
24542456 </script>
2455- <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
2457+ <script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2 /es5/tex-mml-chtml.js"></script>
24562458
2457- <!-- Mermaid.js for diagrams (if used in note ) -->
2459+ <!-- Mermaid.js for diagrams (v10.9.0 ) -->
24582460 <script type="module">
2459- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
2461+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10.9.0 /dist/mermaid.esm.min.mjs';
24602462 const isDark = ${ this . getThemeType ( ) === 'dark' } ;
24612463 mermaid.initialize({
24622464 startOnLoad: false,
0 commit comments