A basic highlighter, not a full language parser
This renders your code into a shareable, editor-styled image with line numbers and a macOS-style title bar, using a lightweight heuristic highlighter that recognizes common keywords across JavaScript, Python, PHP and similar C-like languages, plus strings, comments, and numbers. It is not a complete syntax parser for any one language, so occasionally a token in an unusual language or edge case may not be colored as you would expect.
Why a heuristic highlighter is used instead of a full parser for each language
A complete, accurate parser needs to be built separately for each programming language's specific grammar - a genuinely large undertaking for a simple image-generation tool. A shared heuristic that recognizes common patterns (keywords, strings, comments, numbers) across many C-like and Python-like languages covers the vast majority of real-world snippets reasonably well, which is the practical tradeoff this tool makes in exchange for staying simple and fast.
Why strings and comments take priority over keywords when patterns overlap
A word that looks like a keyword can appear inside a string or a comment, where it should be colored as plain string or comment text rather than as code - resolving overlapping matches by giving comments and strings priority over keyword and number matching avoids the common mistake of, say, highlighting the word "return" as a keyword when it actually appears inside a quoted string or an explanatory comment.
Why this produces a downloadable image rather than styled HTML
A rendered PNG image displays identically everywhere it's shared - a social platform, a chat app, an embedded image in a document - with no dependency on the viewer's app supporting syntax-highlighted HTML or a particular font being installed. That universal compatibility is exactly what makes an image the right output format for a tool meant for sharing code snippets across different platforms.