Render Markdown as complete documents, with GFM extensions - #2
Open
sampokuokkanen wants to merge 3 commits into
Open
Render Markdown as complete documents, with GFM extensions#2sampokuokkanen wants to merge 3 commits into
sampokuokkanen wants to merge 3 commits into
Conversation
ioquatix
force-pushed
the
markdown-extensions
branch
from
August 20, 2026 12:04
8e1d613 to
a0d343f
Compare
Member
|
I've fixed tests on main - do you think you can fix this PR? |
`Markly.render_html` enables no extensions by default, so tables were rendered as literal text, `~~strikethrough~~` was left as-is, bare URLs were not linked, and task lists showed `[ ]`. Enable the standard set, as most Markdown intended for preview is GitHub Flavored.
The Markdown renderer returned a bare fragment, with no doctype, charset or title, and thus nowhere to attach a stylesheet. The directory listing built a document of its own, so the two disagreed. Introduce `Luna::Document`, which both now share, and serve Luna's own assets from `public/` as the last middleware in the stack, so that files in the root take precedence and can override them. Bundle `@socketry/syntax` to highlight code, which can be disabled with `--no-syntax-highlighting`.
The bundled copy of `@socketry/syntax` was installed by hand, with no record of which version it came from. Declare it in `package.json` and install it using the same task as `utopia-project`, so that upgrading is `npm update && bake utopia:components:update`. The task reproduces the committed files exactly.
sampokuokkanen
force-pushed
the
markdown-extensions
branch
from
August 20, 2026 12:17
a0d343f to
d201297
Compare
Contributor
Author
|
@ioquatix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related changes to how Markdown is rendered.
Enable GitHub Flavored Markdown extensions
Markly.render_htmlenables no extensions by default, so tables were rendered as literal text,~~strikethrough~~was left as-is, bare URLs were not linked, and task lists showed[ ]. Enable the standard set, as most Markdown intended for preview is GitHub Flavored.Render complete documents
The Markdown renderer returned a bare fragment, with no doctype, charset or title, and thus nowhere to attach a stylesheet — a table rendered without any borders. The directory listing built a document of its own, so the two disagreed about the structure.
Both now share
Luna::Document, and Luna's own assets are served frompublic/by a secondStaticmiddleware at the end of the stack. Because it is last, files in the root take precedence: dropping_static/luna.cssinto the directory you are serving overrides the bundled stylesheet, without any additional option.@socketry/syntaxis bundled to highlight code, following the same layout asutopia-project:It highlights
<code class="language-*">, which is what cmark-gfm already emits, so no adapter is needed. Disable it with--no-syntax-highlighting.It is declared in
package.jsonand installed with the same task asutopia-project, so upgrading is:npm update && bake utopia:components:updateNotes
@socketry/syntax; the Ruby side is ~180 lines across 9 files, whichgit diff --stat main -- lib test luna.gemspecshows on its own.spec.filesnow includespublic/**/*, andutopiais added to the maintenance group for the components task.