Skip to content

v0.1.3

Choose a tag to compare

@github-actions github-actions released this 01 Sep 23:41
· 10 commits to main since this release

More places a document can come from, more of it drawn, and one crash fixed:
a deeply nested document could take the viewer down, and now cannot.

Fixed

  • Deeply nested input crashed rather than rendering. Fifty thousand nested
    quotes, list items or emphasis markers took the stack down with them, and so
    did a formula with that many nested braces -- every walk over the document
    tree recurses, dropping it included. Both now have a floor: past a hundred
    levels a document stops nesting and its contents join the block already open,
    and past sixty-four a formula is copied as written. Nothing is lost either
    way, and since a document can now arrive from a URL, this is no longer only
    something people could do to themselves.
  • A superscript or subscript that was a command took only the backslash, so
    x^\alpha came out unchanged and y^\frac{1}{2} came out as y^\frac12,
    with the braces dropped and the meaning with them. A command is now one
    thing, arguments and all: x^α and y^½.
  • A directory index took a # comment inside a leading code block for the
    file's heading, so a document that opens with a shell snippet was listed
    under the wrong title.
  • holds_markdown followed symlinks while deciding whether to list a
    subdirectory, and a cycle of them was stopped only by paths eventually
    growing too long to open. It descends into real directories now, eight deep.
  • A protocol-relative URL in a fetched document (//host/x.png) resolved
    against the wrong host.
  • A link to a URL whose host ends in .md was fetched as a document rather
    than handed to the browser.
  • Square brackets in a filename broke the link the directory index generated.
  • termmd big.md | head reported "Broken pipe (os error 32)" and exited
    non-zero. A reader who stops reading is not a failure.

Added

  • y in the pager copies the code block on screen to the system clipboard over
    OSC 52, which works over ssh. It copies the source as written -- no
    highlighting, no line numbers, no trailing newline, so a shell snippet lands
    at a prompt without running. In the links panel, y copies the selected URL.
    Inside tmux the text is handed to tmux load-buffer -w, since tmux does not
    forward an application's OSC 52 unless set-clipboard is on.
  • A URL can be given instead of a file: termmd https://example.com/README.md
    fetches and renders it, resolving the relative links and images inside it
    against where it came from. Naming a URL is asking for it, so there is no flag
    to turn on; the images inside it still wait for --remote-images. In the
    pager, a link to a remote Markdown document opens in termmd rather than in a
    browser, on the same reasoning.
  • A directory can be given too. termmd docs/ lists the Markdown in it, with
    each file's first heading beside its name, as a document whose links the pager
    already knows how to follow -- so a directory tree is browsable, with
    backspace to come back, out of parts that were already there.
  • --front-matter prints a document's YAML front matter. It was already parsed
    and kept out of the page, where it is metadata rather than content, but there
    was no way to ask for it.
  • Maths is rendered into Unicode where Unicode has the characters: scripts
    (x^2 becomes x²), Greek, the comparison and set operators, roots,
    fractions, and blackboard letters. Anything else -- an unknown command, a
    script with no character, a matrix -- passes through as written, which is
    still readable TeX.
  • :shortcode: emoji, from the alias set GitHub accepts. Expanded at render
    time rather than at parse time, so a code span, a code block and --ascii all
    keep the name they were written with.
  • Images and hyperlinks inside tmux, when the terminal tmux is drawing on can
    manage them. tmux answers a capability query on its own behalf -- it claims
    sixel whether or not its client could show one -- so termmd asks tmux what it
    decided the client supports instead. From tmux 3.4 a sixel is drawn by tmux
    itself, with no passthrough involved. Anything older, GNU screen, or a client
    without the feature keeps half blocks, which was the only option before.