mdv-live 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdv-live",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Markdown Viewer - File tree + Live preview + Marp support + Hot reload",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -26,9 +26,6 @@ const MARP_PATTERN = /^---\s*\n[\s\S]*?marp:\s*true[\s\S]*?\n---/;
26
26
  // Pattern to detect YAML frontmatter at start of file
27
27
  const FRONTMATTER_PATTERN = /^---\s*\n([\s\S]*?)\n---\s*(\n|$)/;
28
28
 
29
- // Pattern to detect metadata block after h1 heading (Claude Agent format)
30
- const HEADING_METADATA_PATTERN = /^(#[^\n]+\n+)(---\s*\n)([\s\S]*?)(\n---\s*)(\n|$)/;
31
-
32
29
  // Pattern for Mermaid code blocks
33
30
  const MERMAID_PATTERN = /```mermaid\s*\n([\s\S]*?)\n```/g;
34
31
 
@@ -55,15 +52,6 @@ function convertFrontmatter(content) {
55
52
  return `\`\`\`yaml\n${frontmatter}\n\`\`\`\n${rest}`;
56
53
  }
57
54
 
58
- // Check for metadata block after h1 heading (Claude Agent format)
59
- const headingMatch = content.match(HEADING_METADATA_PATTERN);
60
- if (headingMatch) {
61
- const heading = headingMatch[1];
62
- const metadata = headingMatch[3];
63
- const rest = content.slice(headingMatch[0].length);
64
- return `${heading}\`\`\`yaml\n${metadata}\n\`\`\`\n${rest}`;
65
- }
66
-
67
55
  return content;
68
56
  }
69
57
 
package/src/static/app.js CHANGED
@@ -1615,7 +1615,7 @@
1615
1615
  download(path) {
1616
1616
  const a = document.createElement('a');
1617
1617
  a.href = `/api/download?path=${encodeURIComponent(path)}`;
1618
- a.download = '';
1618
+ a.download = path.split('/').pop() || 'download';
1619
1619
  document.body.appendChild(a);
1620
1620
  a.click();
1621
1621
  document.body.removeChild(a);