Skip to content

Conversation

@plx
Copy link
Owner

@plx plx commented Nov 2, 2025

This change ensures that markdown syntax in titles (like italic and bold) is properly rendered as HTML when displayed on pages, while being stripped for meta tags, browser titles, and Open Graph images.

Changes:

  • Add stripMarkdown() function to remove markdown syntax for plain text contexts
  • Update page templates to render markdown in displayed titles using renderInlineMarkdown()
  • Strip markdown from titles in meta tags, Open Graph data, and browser title
  • Improve semantic HTML by using

    instead of
    for page titles

Fixes issue where asterisks and other markdown syntax appeared literally in article titles instead of being rendered as formatted text.

This change ensures that markdown syntax in titles (like *italic* and **bold**)
is properly rendered as HTML when displayed on pages, while being stripped for
meta tags, browser titles, and Open Graph images.

Changes:
- Add stripMarkdown() function to remove markdown syntax for plain text contexts
- Update page templates to render markdown in displayed titles using renderInlineMarkdown()
- Strip markdown from titles in meta tags, Open Graph data, and browser title
- Improve semantic HTML by using <h1> instead of <div> for page titles

Fixes issue where asterisks and other markdown syntax appeared literally in
article titles instead of being rendered as formatted text.
@github-actions
Copy link

github-actions bot commented Nov 2, 2025

PR Validation ✅

All checks passed! Ready for review.

Checks Performed:

✓ Linting
✓ Spell check (source)
✓ Type checking & Build
✓ Spell check (HTML)
✓ Internal link validation
✓ Artifact upload

This is a complete dry-run of the deployment process, ensuring your changes will deploy successfully when merged.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<div class="animate text-2xl font-semibold text-black dark:text-white">
{post.data.title}
</div>
<h1 class="animate text-2xl font-semibold text-black dark:text-white" set:html={renderedTitle}></h1>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Escape title text before using set:html

The updated title rendering binds renderedTitle directly into set:html, but renderInlineMarkdown purposely leaves any text outside of markdown markers unescaped. If a post title contains literal < characters or HTML (from frontmatter or a CMS), the HTML will now be injected into the page and can execute scripts, whereas the previous {post.data.title} rendering was safely escaped. This creates an XSS vector for untrusted or malformed titles. The same pattern appears in the briefs and projects templates; the HTML output should be sanitized or escaped before using set:html.

Useful? React with 👍 / 👎.

@plx plx merged commit e7a760c into main Nov 2, 2025
2 checks passed
plx added a commit that referenced this pull request Nov 2, 2025
plx added a commit that referenced this pull request Dec 25, 2025
* Content and style updates. (#15)

* Switched from hardcoded ports to using trop.

* Updated `trop` article.

* Ensure list items use article serif font (#13)

* Further article adjustments. (#14)

* Content updates

* Dictionary additions.

* Fix HTML spellcheck failures (#16)

- Fixed typos in generic-testing blog post:
  - 'exapmle' → 'example' (3 instances)
  - 'actuall' → 'actually' (1 instance)
  - 'Algrebra' → 'Algebra' (1 instance)

- Added technical terms to cspell dictionary:
  - microbenchmarks
  - Xcodes
  - metatype/metatypes

All HTML spellcheck tests now pass.

Co-authored-by: Claude <noreply@anthropic.com>

* Fix markdown rendering in article titles (#17)

This change ensures that markdown syntax in titles (like *italic* and **bold**)
is properly rendered as HTML when displayed on pages, while being stripped for
meta tags, browser titles, and Open Graph images.

Changes:
- Add stripMarkdown() function to remove markdown syntax for plain text contexts
- Update page templates to render markdown in displayed titles using renderInlineMarkdown()
- Strip markdown from titles in meta tags, Open Graph data, and browser title
- Improve semantic HTML by using <h1> instead of <div> for page titles

Fixes issue where asterisks and other markdown syntax appeared literally in
article titles instead of being rendered as formatted text.

Co-authored-by: Claude <noreply@anthropic.com>

* The new learn-spelling command.

* Justfile cleanup.

* Spelling incosistency fix.

* Add Claude Code GitHub Workflow (#20)

* "Claude PR Assistant workflow"

* "Claude Code Review workflow"

* Updating gitignore for pending feature.

* Fix ESLint quote style in learn-spelling.js

Change single quotes to double quotes to comply with project ESLint config.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add Claude Code hook for auto-linting on file changes

Configures a PostToolUse hook that runs after Write/Edit operations:
- ESLint fix for js/jsx/ts/tsx/astro files
- Spellcheck for md/mdx files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants