Skip to content

feat(Markdown): fingerprint CSS asset - #1228

Merged
ArgoZhang merged 3 commits into
masterfrom
dev-Markdown
Oct 22, 2026
Merged

ArgoZhang merged 3 commits into
masterfrom
dev-Markdown

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Link issues

fixes #1227

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Enable the Markdown component to load its stylesheet through a version-aware asset URL.

New Features:

  • Add fingerprint-aware resolution for the Markdown component’s CSS asset.

Bug Fixes:

  • Ensure the Markdown component loads its CSS correctly across supported .NET versions, including asset fingerprinting on .NET 9 and later.

Build:

  • Update the Markdown project configuration to support the CSS asset changes.

@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The Markdown component now fingerprints its CSS asset on .NET 9+ by resolving the stylesheet through the asset manifest and passing the resulting URL to JavaScript, while preserving the existing static path for earlier target frameworks.

Sequence diagram for fingerprinted Markdown CSS loading

sequenceDiagram
    participant Markdown as Markdown component
    participant AssetManifest as .NET 9+ asset manifest
    participant JS as Markdown JavaScript
    participant Browser as Browser

    alt .NET 9+
        Markdown->>AssetManifest: Resolve Assets[StylePath]
        AssetManifest-->>Markdown: Fingerprinted styleUrl
    else Earlier target frameworks
        Markdown->>Markdown: Use static StylePath
    end
    Markdown->>JS: init(id, invoker, options, callback, styleUrl)
    JS->>Browser: addLink(styleUrl)
    Browser-->>JS: Stylesheet loaded
Loading

File-Level Changes

Change Details Files
Pass a framework-aware, potentially fingerprinted stylesheet URL from the Blazor component into JavaScript initialization.
  • Define the Markdown CSS asset path centrally.
  • Resolve the asset through the generated asset manifest on .NET 9+ while retaining the static path for earlier targets.
  • Add the resolved URL to the JavaScript initialization contract.
src/components/BootstrapBlazor.Markdown/Components/Markdown/Markdown.razor.cs
src/components/BootstrapBlazor.Markdown/BootstrapBlazor.Markdown.csproj
Load the supplied stylesheet URL instead of hard-coding the Markdown CSS path in JavaScript.
  • Extend the init function to accept a style URL.
  • Use the provided URL when creating the stylesheet link.
src/components/BootstrapBlazor.Markdown/Components/Markdown/Markdown.razor.js

Assessment against linked issues

Issue Objective Addressed Explanation
#1227 Load the Markdown component’s CSS using a fingerprinted asset URL. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto approved by bb-auto

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@ArgoZhang
ArgoZhang merged commit f20fb77 into master Oct 22, 2026
3 checks passed
@ArgoZhang
ArgoZhang deleted the dev-Markdown branch October 22, 2026 03:24
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.

feat(Markdown): fingerprint CSS asset

1 participant