Typograms: A definition and renderer for ASCII diagrams
> <i>A polyfill is available that allows you use to use it in browsers.</i><p>This isn’t a polyfill. Polyfills are about implementing new native stuff on old environments, but no browser is going to be including this any time soon, and certainly not in this form—<p>> <i><script type="text/typogram"></i><p>This should use <pre> instead, e.g. <pre class="typogram">. It’s content, not scripting, and if the JavaScript isn’t run (for whatever reason—JS is less reliable than people often think, especially third-party JS, even on environments that don’t try to block it) you’d like the diagram to still be visible in <i>some</i> form.<p>(Retaining the <pre> would also be a great improvement for selecting text—the current arrangement of “place single-character <text> elements” is almost useless for copy and paste (losing spaces and line breaks), which is the main reason I can imagine wanting such a thing. If character sizes and aspect ratios are a concern, control that stuff with scaling transforms or line-height, and detect and contain (e.g. <span style="overflow:visible;width:…">…</span>) individual characters that are falling out of the grid due to font fallback or bad ligatures like Nimbus Mono <<a href="https://github.com/ArtifexSoftware/urw-base35-fonts/issues/31">https://github.com/ArtifexSoftware/urw-base35-fonts/issues/3...</a>>.)