Skip to content

Bump markdown-rails from 2.1.0 to 2.2.0#940

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/bundler/markdown-rails-2.2.0
Open

Bump markdown-rails from 2.1.0 to 2.2.0#940
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/bundler/markdown-rails-2.2.0

Conversation

@dependabot
Copy link
Copy Markdown
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

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
Copy Markdown
Contributor

lfdebrux commented Dec 4, 2025

@dependabot recreate

@dependabot dependabot bot force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch 2 times, most recently from b33db39 to c4a1351 Compare December 4, 2025 10:27
@lfdebrux
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@lfdebrux lfdebrux force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch from c4a1351 to 9a24664 Compare April 1, 2026 06:40
@lfdebrux
Copy link
Copy Markdown
Contributor

lfdebrux commented Apr 1, 2026

The govuk_markdown PR with the mixin has been merged and the mixin released, so we can refactor our code now to unblock this PR. I've raised #1120, and rebased this PR on that to test that it has had the effect desired.

@lfdebrux
Copy link
Copy Markdown
Contributor

lfdebrux commented Apr 8, 2026

@dependabot rebase

@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot bot commented on behalf of github Apr 8, 2026

Looks like this PR has been edited by someone other than Dependabot. That means Dependabot can't rebase it - sorry!

If you're happy for Dependabot to recreate it from scratch, overwriting any edits, you can request @dependabot recreate.

@lfdebrux
Copy link
Copy Markdown
Contributor

lfdebrux commented Apr 8, 2026

@dependabot recreate

@dependabot dependabot bot force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch from 9a24664 to bab3245 Compare April 8, 2026 09:25
@lfdebrux lfdebrux enabled auto-merge April 8, 2026 09:52
@lfdebrux
Copy link
Copy Markdown
Contributor

lfdebrux commented Apr 8, 2026

@dependabot rebase

@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot bot commented on behalf of github Apr 8, 2026

Looks like this PR is already up-to-date with main! If you'd still like to recreate it from scratch, overwriting any edits, you can request @dependabot recreate.

@lfdebrux
Copy link
Copy Markdown
Contributor

lfdebrux commented Apr 8, 2026

@dependabot rebase

Dependabot couldn't find the original pull request head commit, c4a1351.
@dependabot dependabot bot force-pushed the dependabot/bundler/markdown-rails-2.2.0 branch from bab3245 to 40058f4 Compare April 8, 2026 10:43
@lfdebrux lfdebrux closed this Apr 8, 2026
auto-merge was automatically disabled April 8, 2026 10:54

Pull request was closed

@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot bot commented on behalf of github Apr 8, 2026

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/bundler/markdown-rails-2.2.0 branch April 8, 2026 10:54
@lfdebrux lfdebrux restored the dependabot/bundler/markdown-rails-2.2.0 branch April 8, 2026 10:55
@lfdebrux lfdebrux reopened this Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 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.

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.

1 participant