Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Fall back on rendering the text #9

@seppestas

Description

@seppestas

If the typograms library can't be loaded, e.g. because JS is disabled or the typograms library is slow / fails to load, at least Google Chrome (and presumably all browsers) do not renderer the text.

Possibly a duplicate of #4, though that seems to be more about semantics.

It would be great if the diagrams would just be rendered as monospaced (pre) text instead.

A great example is @samuelgoto's own blog, where the example typograms are no longer shown due to the subdomain changing from code.sgo.to to sgo.to (also breaking the first link in this project's README) and the page not being updated occordingly.

IMHO, iof, using a <script> tag, something like a

 inside  tag should be used, which should also make typogram diagrams more ARIA. E.g.

<body>
  <script src="https://google.github.io/typograms/typograms.js"></script>
  <figure>
    <pre type="text/typogram" role="img">
+----+
|    |---> My first diagram!
+----+
    </pre>
  </figure>
</body>

I'm not sure if the type attribute is explicitly disallowed from being used on pre tags, but I think most browsers should just ignore the attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions