Skip to content

FOLLOW-UP: Consolidate Prism plugin asset handlers via serveVendored helper (from PR #256) #266

Description

@adnaan

Context

PR #256 added four near-identical asset handler blocks for prism-line-highlight.{js,css} and prism-line-numbers.{js,css} in internal/server/server.go serveAsset.

Source PR: #256
Suggested by: @claude[bot]
Comment type: PR review (rounds 1, 5, 8)

Task Description

The four blocks share the same shape: match path, set Cache-Control, set Content-Type, write asset. A small helper:

func serveVendored(w http.ResponseWriter, contentType string, body []byte) {
    w.Header().Set(\"Cache-Control\", \"public, max-age=31536000\")
    w.Header().Set(\"Content-Type\", contentType)
    w.Write(body)
}

…would reduce the four blocks to four single-line calls and make adding future Prism plugins a one-liner. Style only, not blocking.

Original Comment

The four blocks (prism-line-highlight.js/css, prism-line-numbers.js/css) are structurally identical. A small helper would reduce the duplication. Style only.
@claude[bot], round 2


Auto-created by /prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-lowLow: extended features, operational docsfollow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions