Release v1.9.2: Full-width background for code blocks

Fixed code block and ASCII art background to extend full paragraph width:

🔧 Background Fix:
- Moved shading (w:shd) from run level (<w:rPr>) to paragraph level (<w:pPr>)
- Background now extends full width like in the preview
- Applied to both createCodeBlockXml() and createAsciiArtXml() functions

📝 Technical Changes:
- src/wordTemplateExporter.js: Paragraph-level shading for full-width backgrounds
- Added w:ind with left="284" right="284" for consistent margins
- Removed redundant w:shd from run properties

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-12 09:10:18 +05:30
co-authored by Claude
parent cb98549db8
commit d8e0748037
5 changed files with 15 additions and 12 deletions
+2 -1
View File
@@ -20,7 +20,8 @@
"Read(//c/Program Files/MiKTeX/miktex/bin/x64/**)",
"Bash(findstr:*)",
"Bash(cmd /c \"dir /b H:\\Coding\\pan-converter\\dist\\*.exe H:\\Coding\\pan-converter\\dist\\*.zip 2>nul | findstr 1.9.1\")",
"Bash(cmd /c \"dir H:\\Coding\\pan-converter\\dist\\*1.9.1*\")"
"Bash(cmd /c \"dir H:\\Coding\\pan-converter\\dist\\*1.9.1*\")",
"Bash(gh release create v1.9.1 --title \"v1.9.1: ASCII Art & Code Block Preservation\" --notes \"$(cat <<''EOF''\n# Release v1.9.1: ASCII Art & Code Block Preservation\n\n## 🎯 Overview\nThis release fixes the export of ASCII art, charts, tables, and flowcharts to match the preview exactly. Code blocks now export with perfect monospace formatting, preserving all line breaks, spacing, and box-drawing characters.\n\n## 🎨 What''s Fixed\n\n### ASCII Art & Code Block Preservation\n- **Code blocks now export exactly as shown in preview**\n- Each line rendered separately to preserve exact spacing and alignment\n- Monospace font (Consolas) used consistently across all export formats\n- Box-drawing characters, arrows, and flowcharts render correctly\n- No more text wrapping or broken formatting in exports\n\n### Export Format Improvements\n\n#### DOCX (Enhanced) - Word Template Exporter\n- Each code line rendered as separate paragraph with exact spacing\n- Added `<w:keepLines/>` and `<w:wordWrap w:val=\"0\"/>` XML properties\n- Light gray background (#F5F5F5) for visual distinction\n- Perfect alignment preserved for ASCII art and flowcharts\n\n#### PDF Export (All Methods)\n- Added `-V monofont=\"Consolas\"` for proper code block rendering\n- Added `--highlight-style=tango` for syntax highlighting\n- Works with XeLaTeX, PDFLaTeX, and LuaLaTeX engines\n\n#### HTML & Electron PDF Fallback\n- Enhanced CSS: `white-space: pre`, `word-wrap: normal`\n- Print media queries preserve code block formatting\n- `overflow: visible` prevents content truncation\n\n### Improved ASCII Art Detection\n- Extended Unicode box-drawing character support\n- Added rounded corners: ╭╮╯╰\n- Added heavy box characters: ┃━┏┓┗┛┣┫┳┻╋\n- Added more arrow types: ↔↕⇒⇐⇓⇑\n- Additional ASCII patterns detected\n\n## 📦 Available Downloads\n\nChoose the package that suits your needs:\n\n1. **PanConverter-Setup-1.9.1.exe** (Recommended)\n - Full installer with uninstaller\n - File associations and Start Menu shortcuts\n - ~104 MB\n\n2. **PanConverter-1.9.1-x64.exe**\n - Portable executable, no installation required\n - Run directly from any folder\n - ~104 MB\n\n3. **PanConverter-1.9.1-x64.zip**\n - ZIP archive with unpacked application\n - For manual extraction and deployment\n - ~145 MB (uncompressed files)\n\n## 🔧 Technical Changes\n\n### Code Changes\n- `src/wordTemplateExporter.js`: Enhanced `createCodeBlockXml()` - renders each line separately\n- `src/wordTemplateExporter.js`: Improved `isAsciiArt()` - extended character detection\n- `src/main.js`: Added monofont settings to all PDF export paths\n- `src/main.js`: Enhanced HTML/Electron PDF export CSS\n\n### Key Properties for ASCII Preservation\n```css\npre {\n white-space: pre;\n word-wrap: normal;\n font-family: Consolas, Monaco, ''Courier New'', monospace;\n}\n```\n\n```xml\n<w:pPr>\n <w:keepLines/>\n <w:wordWrap w:val=\"0\"/>\n <w:spacing w:line=\"240\" w:lineRule=\"exact\"/>\n</w:pPr>\n```\n\n## 🔄 Upgrade Notes\n\nIf upgrading from v1.9.0 or earlier:\n- All your settings and preferences will be preserved\n- Recent files list will remain intact\n- Word template selections will be maintained\n- No breaking changes to existing workflows\n\n## 📝 Installation Instructions\n\n### Using the Installer (Recommended)\n1. Download `PanConverter-Setup-1.9.1.exe`\n2. Run the installer\n3. Follow the installation wizard\n4. Launch from Start Menu or Desktop shortcut\n\n### Using Portable Version\n1. Download `PanConverter-1.9.1-x64.exe`\n2. Save to any folder (e.g., Documents, Desktop)\n3. Double-click to run (no installation needed)\n4. Create your own shortcut if desired\n\n## 💬 Feedback\nHave suggestions or found a bug? Please [open an issue](https://github.com/amitwh/pan-converter/issues).\n\n---\n\n**Full Changelog**: https://github.com/amitwh/pan-converter/compare/v1.9.0...v1.9.1\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>\nEOF\n)\" \"dist/PanConverter-1.9.1-x64.exe\" \"dist/PanConverter-1.9.1-x64.zip\" \"dist/PanConverter-Setup-1.9.1.exe\")"
],
"deny": [],
"ask": []