Render markdown code spans and fences #29
No reviewers
Labels
No labels
activitypub
actor
admin
ai-safety
article
articles
atproto
bug
cli
configuration
content
dev-environment
docker
enhancement
feature
federation
fediverse
forgejo
garage
health
how-to
logging
markdown
mastodon
media
navigation
opengraph
passkeys
preview
priority:medium
production
release
rendering
s3
settings
setup
status:active
status:done
status:inprogress
technical
webauthn
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
erik/slugkit.com!29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task-b9d11dc6-markdown-code"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
<code><pre><code>with safe language classesVerification
slug-cli-initrenders inline code and fenced bash blocks in ChromiumTask: task-b9d11dc6
Review summary
Approved. The PR adds semantic rendering for inline code spans and fenced code blocks while preserving the existing safe markdown behavior.
Acceptance criteria
`slug`renders as<code>slug</code>.renderInlineMarkdownnow extracts backtick spans into<code>placeholders before other inline formatting.<pre><code>...</code></pre>or equivalent semantic HTML.renderMarkdownBlocknow detects triple-backtick blocks and emits<pre><code>.bashare preserved as a safe class or metadata where practical.[A-Za-z0-9_-], normalized, escaped, and rendered asclass="language-bash".escapeHtml; tests cover<script>inside fenced code.Blocking issues
None.
Warnings
None.
Verdict
Approved.
242609df79tobb11a46f66Updated PR #29 to use Tailwind Typography for markdown presentation, not just semantic code rendering.
Changes added:
@tailwindcss/typography@plugin "@tailwindcss/typography".post-contentarbitrary descendant styling withprose prose-gray ... dark:prose-invertpre, code { white-space: pre-wrap; }override so code blocks can scroll correctlyVerification rerun:
npm run typechecknpm test -- --run src/routes/__tests__/public.test.tsnpm testnpm run build.post-contenthasprose, inline<code>slug</code>exists, fenced<pre><code class="language-bash">...exists,prewhite-space ispre, overflow-x isauto.bb11a46f66tob30293df34Review summary
Approved after amendment. The PR now addresses both sides of markdown rendering: semantic markdown-to-HTML for code spans/fences and proper article presentation through Tailwind Typography.
Acceptance criteria
`slug`renders as<code>slug</code>.<pre><code>...</code></pre>.bashare preserved safely aslanguage-bash.@tailwindcss/typography,prose,dark:prose-invert) instead of hand-rolled descendant styling.Verification
npm run typechecknpm test -- --run src/routes/__tests__/public.test.tsnpm testnpm run build.post-contenthasprose, inline<code>slug</code>exists, fenced<pre><code class="language-bash">...exists, and code blocks scroll normally.Blocking issues
None.
Warnings
None.
Verdict
Approved.