Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 11, 2025

Bumps markdown-rails from 2.1.0 to 2.2.0.

Commits
  • 54444c5 Bump version
  • e49576b Set a default view context
  • 1181cdc Use template handler
  • 9114355 Put attr_writer :view_context back
  • 1e25b61 Initialize with options
  • 154c018 Delegate helpers
  • d67af04 Change from instance to class for renderers
  • d7ac839 Use Rails helpers for views instead of delegation
  • 94a5a08 Pass view_context to markdown rails renderer
  • 2e3e953 Add Github CI workflow
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code labels Nov 11, 2025
@dependabot dependabot bot force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch 2 times, most recently from 134e8ef to ec0d3b1 Compare November 13, 2025 14:35
@chao-xian chao-xian force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch from ec0d3b1 to 10b14cc Compare November 13, 2025 15:17
@lfdebrux
Copy link
Member

lfdebrux commented Dec 4, 2025

@dependabot recreate

@dependabot dependabot bot force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch from 10b14cc to b33db39 Compare December 4, 2025 06:23
Bumps [markdown-rails](https://github.com/sitepress/markdown-rails) from 2.1.0 to 2.2.0.
- [Commits](sitepress/markdown-rails@v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: markdown-rails
  dependency-version: 2.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch from b33db39 to c4a1351 Compare December 4, 2025 10:27
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-940.www.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@lfdebrux
Copy link
Member

lfdebrux commented Dec 4, 2025

Our usage of this gem is so basic, that these test failures feel like a bug in the gem. Note that https://pr-940.www.review.forms.service.gov.uk/features is also giving a 500 error. There aren't any open issues that are related though, so we might need to put together a bug report ourselves.

Oh I see what's happened, the way ApplicationMarkdown works in the install template has changed in sitepress/markdown-rails@94a5a08. We just need to change our ApplicationMarkdown class to match. Would have been nice to have some release notes about that... This is because our ApplicationMarkdown has diverged somewhat. Let's see if we can bring it closer to the original...

@lfdebrux
Copy link
Member

So what's happening here in detail:

  • the markdown-rails gem creates a subclass of Redcarpet::Render::HTML to add its functionality, in MarkdownRails::Renderer::Rails, and expects us to subclass that in our own ApplicationMarkdown
  • however, the govuk-markdown also creates a subclass of Redcarpet::Render::HTML in GovukMarkdown::Renderer to make its changes work
  • Ruby doesn't have multiple inheritance for classes, so we when we write ApplicationMarkdown we have to pick either MarkdownRails::Renderer::Rails or GovukMarkdown::Renderer as the superclass, and then find a way to incorporate the changes needed from the other class
  • currently we're inheriting from GovukMarkdown::Renderer and trying to make the expected interface for markdown-rails work by basically copying and pasting

However that is brittle, as seen with this version bump; the interface has changed (which is fair, this isn't the documented way of using the library), so to make our code work again we need to copy the changes from markdown-rails. Which is annoying and work we'd rather not be doing, we might as well just vendor the code.

Making the two gems work together would be easier if one or both exposed mixins so that we could create a class that inherits methods from both, but currently neither gem does.

@lfdebrux
Copy link
Member

I've raised a PR against govuk-markdown suggesting adding a mixin module that we can use to simplify our usage with markdown-rails:

DFE-Digital/govuk-markdown#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants