Skip to content

Conversation

@donnfelker
Copy link
Contributor

Add the ability to provide additional classes to the <pre> tag.

Usage:

activate :syntax, :classes => ['not-prose']

Use Case:
When you're rendering code inside of tailwind typography prose classes, which we do in RubyStaticPro prose will try to take over the rendering of the code block. To stop this from happening you can apply the not-prose class and tailwindcss typography will not format it. See docs here

This update allows you to provide additional classes that will be rendered to the <pre> tag.

In the config.rb

activate :syntax, :classes => ['not-prose']

Result:

<div class="highlight">
-  <pre class="highlight ruby">...</pre>
+  <pre class="highlight ruby not-prose">...</pre>
</div>

@markets
Copy link
Member

markets commented Apr 6, 2025

Thanks @donnfelker! Just added a couple of minor comments, but +1 for the feature 👍

Copy link
Member

@markets markets left a comment

Choose a reason for hiding this comment

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

Thanks @donnfelker! Test failures are unrelated, fixed them on master (5ca4c2a).

@markets markets merged commit 159c7ba into middleman:master Apr 7, 2025
0 of 5 checks passed
@donnfelker
Copy link
Contributor Author

Fantastic! Thanks for accepting the PR 🎉

@markets
Copy link
Member

markets commented Apr 7, 2025

@donnfelker New version pushed to RubyGems: https://rubygems.org/gems/middleman-syntax/versions/3.5.0 🎉

@donnfelker
Copy link
Contributor Author

Thank you so much!

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.

2 participants