Mercurial
comparison mrjunejune/test/snapshots/tools_markdown_to_html.snapshot @ 94:092afa595764
[MrJuneJune] Added Integration tests.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Fri, 02 Jan 2026 18:13:32 -0800 |
| parents | |
| children | 1c446ab6f945 |
comparison
equal
deleted
inserted
replaced
| 93:be91a73d801a | 94:092afa595764 |
|---|---|
| 1 HTTP/1.1 200 OK | |
| 2 Content-Type: text/html | |
| 3 Content-Length: 5891 | |
| 4 Connection: close | |
| 5 | |
| 6 <!DOCTYPE html> | |
| 7 <html lang="en"> | |
| 8 <head> | |
| 9 <meta charset="UTF-8"> | |
| 10 <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| 11 <title>Markdown to HTML Converter</title> | |
| 12 <link rel="icon" type="image/svg+xml" href="/public/epi_all_colors.svg"> | |
| 13 | |
| 14 <link rel="preload" href="/public/fonts/Roboto-Regular.ttf" as="font" crossorigin> | |
| 15 <link rel="preload" href="/public/fonts/Roboto-Thin.ttf"as="font" crossorigin> | |
| 16 | |
| 17 <link rel="preload" href="/public/fonts/atkinson-regular.woff" as="font" type="font/woff" crossorigin> | |
| 18 <link rel="preload" href="/public/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin> | |
| 19 | |
| 20 <link rel="preload" href="/public/fonts/more-sugar.extras.otf" as="font" type="font/otf" crossorigin> | |
| 21 <link rel="preload" href="/public/fonts/more-sugar.regular.otf" as="font" type="font/otf" crossorigin> | |
| 22 <link rel="preload" href="/public/fonts/more-sugar.thin.otf" as="font" type="font/otf" crossorigin> | |
| 23 | |
| 24 <link rel="preload" href="/base.css" as="style" /> | |
| 25 <link rel="stylesheet" href="/base.css" /> | |
| 26 | |
| 27 | |
| 28 <link rel="stylesheet" href="markdown_to_html/index.css" /> | |
| 29 </head> | |
| 30 <body> | |
| 31 <style> | |
| 32 :root { | |
| 33 --header-background: var(--white); | |
| 34 --header-color: rgb(var(--black)); | |
| 35 --link-hover-accent: var(--awesome); | |
| 36 } | |
| 37 | |
| 38 /* Fixed icon in top left corner */ | |
| 39 #themeToggle { | |
| 40 position: fixed; | |
| 41 top: 20px; | |
| 42 left: 20px; | |
| 43 background: var(--header-background); | |
| 44 display: flex; | |
| 45 align-items: center; | |
| 46 border-radius: 50%; | |
| 47 cursor: pointer; | |
| 48 z-index: 1000; | |
| 49 box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
| 50 transition: transform 0.2s ease; | |
| 51 } | |
| 52 | |
| 53 #themeToggle:hover { | |
| 54 transform: scale(1.05); | |
| 55 } | |
| 56 | |
| 57 /* Professional header */ | |
| 58 header { | |
| 59 margin: auto; | |
| 60 padding: 1.5em 1em; | |
| 61 font-family: "More", sans-serif; | |
| 62 box-shadow: 0 2px 8px rgba(var(--black), 5%); | |
| 63 width: 720px; | |
| 64 max-width: calc(100% - 2em); | |
| 65 text-align: center; | |
| 66 } | |
| 67 | |
| 68 header h1 { | |
| 69 margin: 0; | |
| 70 font-size: 1.8em; | |
| 71 font-weight: 700; | |
| 72 letter-spacing: -0.5px; | |
| 73 } | |
| 74 | |
| 75 header h1 a { | |
| 76 text-decoration: none; | |
| 77 color: var(--header-color); | |
| 78 } | |
| 79 | |
| 80 header h1 a::before { | |
| 81 display: none; | |
| 82 } | |
| 83 | |
| 84 /* Mobile responsiveness */ | |
| 85 @media (max-width: 720px) { | |
| 86 #themeToggle { | |
| 87 top: 15px; | |
| 88 left: 15px; | |
| 89 } | |
| 90 | |
| 91 header { | |
| 92 padding: 1em; | |
| 93 } | |
| 94 | |
| 95 header h1 { | |
| 96 font-size: 1.5em; | |
| 97 } | |
| 98 } | |
| 99 | |
| 100 @media (max-width: 480px) { | |
| 101 #themeToggle { | |
| 102 top: 10px; | |
| 103 left: 10px; | |
| 104 } | |
| 105 | |
| 106 #themeToggle img { | |
| 107 height: 40px; | |
| 108 width: 40px; | |
| 109 } | |
| 110 | |
| 111 header h1 { | |
| 112 font-size: 1.3em; | |
| 113 } | |
| 114 } | |
| 115 | |
| 116 #logo { | |
| 117 width: 300px; | |
| 118 } | |
| 119 | |
| 120 /* 1. DEFINE THE DEFAULTS (Light Mode) */ | |
| 121 :root { | |
| 122 --logo-invert: invert(0); | |
| 123 --epi-grayscale: grayscale(0) brightness(1); | |
| 124 } | |
| 125 | |
| 126 /* 2. MANUAL DARK OVERRIDE */ | |
| 127 html.dark { | |
| 128 --logo-invert: invert(1); | |
| 129 --epi-grayscale: grayscale(1); | |
| 130 } | |
| 131 | |
| 132 /* 3. MANUAL LIGHT OVERRIDE */ | |
| 133 html.light-mode { | |
| 134 --logo-invert: invert(0); | |
| 135 --epi-grayscale: brightness(2.9) grayscale(1); | |
| 136 } | |
| 137 | |
| 138 /* 4. SYSTEM PREFERENCE */ | |
| 139 @media (prefers-color-scheme: dark) { | |
| 140 :root:not(.light-mode) { | |
| 141 --logo-invert: invert(1); | |
| 142 } | |
| 143 } | |
| 144 | |
| 145 /* 5. APPLY TO ELEMENTS */ | |
| 146 #logo { | |
| 147 -webkit-filter: var(--logo-invert); | |
| 148 filter: var(--logo-invert); | |
| 149 transition: filter 0.3s ease; | |
| 150 } | |
| 151 | |
| 152 .epi-logo { | |
| 153 -webkit-filter: var(--epi-grayscale); | |
| 154 filter: var(--epi-grayscale); | |
| 155 transition: filter 0.3s ease; | |
| 156 } | |
| 157 </style> | |
| 158 | |
| 159 <div id="themeToggle"> | |
| 160 <img id="epiChan" class="epi-logo" aria-label="Toggle dark mode" src="/public/epi_all_colors.svg" height="50" width="50"> | |
| 161 </div> | |
| 162 | |
| 163 <header> | |
| 164 <h1><a href="/">MrJuneJune</a></h1> | |
| 165 </header> | |
| 166 <script src="/index.js"></script> | |
| 167 | |
| 168 | |
| 169 <div class="header"> | |
| 170 <h1>Markdown to HTML Converter</h1> | |
| 171 </div> | |
| 172 | |
| 173 <div class="container"> | |
| 174 <div class="panel"> | |
| 175 <div class="label">Markdown Input</div> | |
| 176 <textarea id="input" placeholder="Type your markdown here..."># Welcome to Markdown Converter | |
| 177 | |
| 178 ## Features | |
| 179 | |
| 180 This converter supports: | |
| 181 | |
| 182 - **Bold text** and *italic text* | |
| 183 - [Links](https://example.com) | |
| 184 - `inline code` | |
| 185 - ~~strikethrough~~ | |
| 186 | |
| 187 ### Lists | |
| 188 | |
| 189 1. Ordered lists | |
| 190 2. Like this one | |
| 191 3. With numbers | |
| 192 | |
| 193 - Unordered lists | |
| 194 - Use dashes | |
| 195 - Or asterisks | |
| 196 | |
| 197 ### Code Blocks | |
| 198 | |
| 199 ``` | |
| 200 function example() { | |
| 201 return "Hello World"; | |
| 202 } | |
| 203 ``` | |
| 204 | |
| 205 ### Blockquotes | |
| 206 | |
| 207 > This is a blockquote | |
| 208 > It can span multiple lines | |
| 209 | |
| 210 --- | |
| 211 | |
| 212 ### Images | |
| 213 | |
| 214  | |
| 215 | |
| 216 **Try editing this text!**</textarea> | |
| 217 </div> | |
| 218 | |
| 219 <div class="panel"> | |
| 220 <div class="title"> | |
| 221 <div class="label">HTML Output</div> | |
| 222 <button id="copy"> Copy </button> | |
| 223 </div> | |
| 224 <div id="output"></div> | |
| 225 </div> | |
| 226 </div> | |
| 227 <div style="display: flex; align-items: center; justify-content: center; margin: 30px 0px;"> | |
| 228 <small>© 2026 June Park</small> | |
| 229 </div> | |
| 230 | |
| 231 <script src="/markdown_to_html.js"></script> | |
| 232 <script> | |
| 233 function convert() { | |
| 234 output.innerHTML = ''; | |
| 235 const markdown = input.value; | |
| 236 renderMarkdown(output, markdown); | |
| 237 } | |
| 238 input.addEventListener('input', convert); | |
| 239 | |
| 240 convert(); | |
| 241 | |
| 242 copy.addEventListener('click', () => { | |
| 243 const htmlBlob = new Blob([output.innerHTML], { type: 'text/html'}); | |
| 244 const textBlob = new Blob([output.innerText], { type: 'text/plain'}); | |
| 245 const data = [new ClipboardItem({ | |
| 246 'text/html': htmlBlob, | |
| 247 'text/plain': textBlob | |
| 248 })]; | |
| 249 navigator.clipboard.write(data).then(() => { | |
| 250 copy.textContent = "Copied!"; | |
| 251 setTimeout(() => { | |
| 252 copy.textContent = "Copy"; | |
| 253 copy.classList.remove('success'); | |
| 254 }, 1000); | |
| 255 }).catch(err => { | |
| 256 console.error('Failed to copy: ', err); | |
| 257 }); | |
| 258 }); | |
| 259 </script> | |
| 260 </body> | |
| 261 </html> |