Changeset 3435896
- Timestamp:
- 01/09/2026 12:30:59 PM (3 months ago)
- Location:
- markdown-renderer-for-github/trunk
- Files:
-
- 1 added
- 6 edited
-
assets/css/mermaid-zoom-modal.css (modified) (2 diffs)
-
assets/js/gfmr-main.js (modified) (2 diffs)
-
assets/js/gfmr-mermaid-lightbox.js (added)
-
changelog.txt (modified) (1 diff)
-
includes/class-gfmr-asset-manager.php (modified) (2 diffs)
-
markdown-renderer-for-github.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
markdown-renderer-for-github/trunk/assets/css/mermaid-zoom-modal.css
r3428419 r3435896 188 188 max-width: none !important; 189 189 max-height: none !important; 190 width: auto !important;191 height: auto !important;192 190 cursor: default; 191 background: #fff; 192 border-radius: 4px; 193 padding: 16px; 193 194 } 194 195 … … 417 418 } 418 419 } 420 421 /* Clickable diagram indicator - single source of truth for cursor */ 422 .gfmr-mermaid-container[role="button"] { 423 cursor: zoom-in; 424 transition: opacity 0.2s ease; 425 } 426 427 .gfmr-mermaid-container[role="button"]:hover { 428 opacity: 0.9; 429 } 430 431 .gfmr-mermaid-container[role="button"]:focus { 432 outline: 2px solid var(--gfmr-primary-color, #0969da); 433 outline-offset: 2px; 434 border-radius: 4px; 435 } 436 437 .gfmr-mermaid-container[role="button"]:focus:not(:focus-visible) { 438 outline: none; 439 } -
markdown-renderer-for-github/trunk/assets/js/gfmr-main.js
r3435320 r3435896 772 772 }, 773 773 774 /** 775 * Add lightbox trigger to Mermaid diagram container 776 * @param {HTMLElement} container - Outer container 777 * @param {HTMLElement} innerContainer - Inner container with SVG 778 */ 779 addLightboxTrigger(container, innerContainer) { 780 // Set ARIA attributes (cursor style is defined in CSS) 781 container.setAttribute('role', 'button'); 782 container.setAttribute('tabindex', '0'); 783 container.setAttribute('aria-label', 'Click to expand diagram'); 784 container.setAttribute('aria-haspopup', 'dialog'); 785 container.setAttribute('aria-expanded', 'false'); 786 787 let touchEndTime = 0; 788 789 const openLightbox = () => { 790 if (window.wpGfm?.lightbox) { 791 window.wpGfm.lightbox.open(innerContainer); 792 } 793 }; 794 795 // Record touch end time 796 container.addEventListener('touchend', () => { 797 touchEndTime = Date.now(); 798 }); 799 800 // Click handler (ignore clicks immediately after touch) 801 container.addEventListener('click', (e) => { 802 if (Date.now() - touchEndTime < 300) return; 803 if (e.target.closest('.gfmr-copy-button')) return; 804 openLightbox(); 805 }); 806 807 // Keyboard accessibility 808 container.addEventListener('keydown', (e) => { 809 if (e.key === 'Enter' || e.key === ' ') { 810 e.preventDefault(); 811 openLightbox(); 812 } 813 }); 814 }, 815 774 816 // Language detection - delegate to external module 775 817 detectLanguage(element) { … … 1281 1323 this.addCopyButton(innerContainer, content, "mermaid"); 1282 1324 1325 // Add click-to-expand functionality 1326 this.addLightboxTrigger(outerContainer, innerContainer); 1327 1283 1328 console.log( 1284 1329 "[WP GFM v2 Hotfix] Mermaid processing completed with dual-container centering", -
markdown-renderer-for-github/trunk/changelog.txt
r3435379 r3435896 7 7 8 8 ## [Unreleased] 9 10 ## [1.11.0] - 2026-01-09 11 ### Added 12 - Add -y/--yes flag for non-interactive deployment 13 - Add Mermaid diagram lightbox with zoom and pan 14 ### Documentation 15 - Add deployment best practices and troubleshooting 16 17 ## [1.10.3] - 2026-01-09 18 ### Fixed 19 - Fix undefined GFMR_PLUGIN_DIR constant causing production failure 20 - Include production vendor dependencies in release package 21 - Add GFMR_PATH to PHPStan baseline 22 - Remove duplicate changelog entries 23 ### Documentation 24 - Add v1.10.1 changelog entries 25 - Update v1.10.2 changelog 9 26 10 27 ## [1.10.2] - 2026-01-09 -
markdown-renderer-for-github/trunk/includes/class-gfmr-asset-manager.php
r3435320 r3435896 48 48 true 49 49 ); 50 51 // Mermaid Lightbox module - conditional loading 52 if ( $this->may_have_mermaid_content() ) { 53 wp_enqueue_script( 54 'gfmr-mermaid-lightbox', 55 $plugin_url . 'assets/js/gfmr-mermaid-lightbox.js', 56 array( 'gfmr-main' ), 57 $cache_buster, 58 true 59 ); 60 } 50 61 51 62 // Preload critical libraries to reduce FOUC … … 263 274 264 275 /** 276 * Check if content may contain Mermaid diagrams 277 * 278 * @return bool Possibility of Mermaid diagrams existing 279 */ 280 public function may_have_mermaid_content() { 281 global $post; 282 283 if ( ! $post ) { 284 return false; 285 } 286 287 $content = $post->post_content; 288 289 // Check Mermaid code block notation 290 if ( preg_match( '/```mermaid/i', $content ) ) { 291 return true; 292 } 293 294 // Check Mermaid class in HTML 295 if ( strpos( $content, 'language-mermaid' ) !== false ) { 296 return true; 297 } 298 299 // Check Mermaid diagram types 300 $mermaid_types = array( 'flowchart', 'sequenceDiagram', 'classDiagram', 'stateDiagram', 'erDiagram', 'gantt', 'pie', 'gitGraph', 'journey' ); 301 foreach ( $mermaid_types as $type ) { 302 if ( strpos( $content, $type ) !== false ) { 303 return true; 304 } 305 } 306 307 return false; 308 } 309 310 /** 265 311 * Preload critical libraries to reduce FOUC 266 312 * -
markdown-renderer-for-github/trunk/markdown-renderer-for-github.php
r3435379 r3435896 4 4 * Plugin URI: https://github.com/wakalab/markdown-renderer-for-github 5 5 * Description: Renders GFM (GitHub Flavored Markdown) content beautifully on the front end using JavaScript libraries. It supports syntax highlighting for code blocks and diagram rendering with Mermaid.js. 6 * Version: 1.1 0.26 * Version: 1.11.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 8.1 -
markdown-renderer-for-github/trunk/readme.txt
r3435379 r3435896 6 6 Tested up to: 6.9 7 7 Requires PHP: 8.1 8 Stable tag: 1.1 0.28 Stable tag: 1.11.0 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 127 127 == Changelog == 128 128 129 = 1.10.1 = 129 = 1.11.0 = 130 * Add -y/--yes flag for non-interactive deployment 131 * Add Mermaid diagram lightbox with zoom and pan 132 * Add deployment best practices and troubleshooting 133 134 = 1.10.3 = 135 * Fix undefined GFMR_PLUGIN_DIR constant causing production failure 136 * Include production vendor dependencies in release package 137 * Add GFMR_PATH to PHPStan baseline 138 * Remove duplicate changelog entries 139 * Add v1.10.1 changelog entries 140 * Update v1.10.2 changelog 141 142 = 1.10.2 = 130 143 * Fix undefined GFMR_PLUGIN_DIR constant causing production failure 131 144 * Include production vendor dependencies (highlight.php) in release package 145 * Add GFMR_PATH to PHPStan baseline 132 146 133 147 = 1.10.0 = … … 205 219 * Stabilize Mermaid/Shiki rendering in editor preview 206 220 * Clean up security audit temporary result files 207 208 = 1.7.0 =209 * Add commit-language setting for English commit messages210 * Add i18n workflow for translate.wordpress.org211 * Fix Mermaid User Journey diagram not rendering in editor212 * WordPress 6.8+ iframe compatibility and CI optimization213 * Update readme.txt and changelog for WordPress.org i18n214 215 = 1.6.0 =216 * Convert Japanese comments to English for WordPress.org compliance217 221 218 222 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.