middleman-syntax 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c41f2663b48aae350425db1c725c5e879f8c2bf70eeee2daa85011a7975f99ba
4
- data.tar.gz: c6e893e03faa6f466783e26fc95a44df915aa435c8c87ca7c83253b0ef44b0aa
3
+ metadata.gz: 30c25881bfd1e91ef4958299d4e09fe9848a4581fe3b22bdaf9aad0ae13e2723
4
+ data.tar.gz: 8ed74ea53b6e515c01be63330170110d809f87bf48715fe386245c939cac8998
5
5
  SHA512:
6
- metadata.gz: 8c812e2f320378a9b8e64344974e0277d0904f7834358b1878f93e5305f98bd2a3d7cc90b62bab720d2cfadea0d25ac27ef45709e4a1be58b9f4cae401d88338
7
- data.tar.gz: b5e220fb0f0fee8c712779619e9cda036b2438e9f8bd571e9f65e24aad5e1bd10fe1f134db4e7140818cc574381d67d05a924171e7aaef5a8b5627cf54413a8e
6
+ metadata.gz: 390e71b77bb6d00ebbc57b2702ba4731aa00a0778cfa2caa121d80296aa50b978a6a191620f93bcecf5127104128618e65987754d179a65c79a4675013e35717
7
+ data.tar.gz: df4eb1fec24e35e553d92e346d0b2dad4f368064a4926e3cc0a4a0bcb102eec2a17acfc652ee3151c057db75b76cb410c8452cd159202e340e3e1b8157455acb
data/.gitignore CHANGED
@@ -2,16 +2,14 @@
2
2
  coverage
3
3
  rdoc
4
4
  pkg
5
- .sass-cache
6
- .sassc
7
5
  .tmp
8
6
  Gemfile.lock
9
7
  docs
10
- .rbenv-*
11
8
  .*.swp
12
9
  build
13
10
  doc
14
11
  .yardoc
15
12
  tmp
16
13
  Makefile
17
- .mm-pid-*
14
+ .bundle
15
+ vendor/bundle
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ # 3.6.0
6
+
7
+ - Lexer options don't get passed to lexer (#92).
8
+
5
9
  # 3.5.0
6
10
 
7
11
  - Remove official support for Ruby 2.5 and 2.6 (#89).
data/Gemfile CHANGED
@@ -19,4 +19,3 @@ gem 'haml', RUBY_VERSION > '3.0' ? '< 7' : '< 6'
19
19
  gem 'slim'
20
20
  gem 'kramdown'
21
21
  gem 'redcarpet'
22
- gem 'rack'
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Middleman-Syntax
2
2
 
3
- `middleman-syntax` is an extension for the [Middleman] static site generator that adds syntax highlighting via [Rouge](https://github.com/jayferd/rouge).
3
+ `middleman-syntax` is an extension for the [Middleman](https://middlemanapp.com) static site generator that adds syntax highlighting via [Rouge](https://github.com/jayferd/rouge).
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/middleman-syntax.svg)][gem]
5
+ [![Gem Version](https://badge.fury.io/rb/middleman-syntax.svg)](https://rubygems.org/gems/middleman-syntax)
6
6
  [![CI](https://github.com/middleman/middleman-syntax/actions/workflows/ci.yml/badge.svg)](https://github.com/middleman/middleman-syntax/actions/workflows/ci.yml)
7
- [![Code Quality](https://codeclimate.com/github/middleman/middleman-syntax.svg)][codeclimate]
7
+ [![Maintainability](https://qlty.sh/gh/middleman/projects/middleman-syntax/maintainability.svg)](https://qlty.sh/gh/middleman/projects/middleman-syntax)
8
8
 
9
9
  ## Installation
10
10
 
@@ -59,7 +59,7 @@ end
59
59
  <% end %>
60
60
  ```
61
61
 
62
- *Note:* In Haml, use `=`, not `-`:
62
+ **NOTE:** In Haml, use `=`, not `-`:
63
63
 
64
64
  ```haml
65
65
  = code('ruby') do
@@ -105,6 +105,7 @@ end
105
105
  ```
106
106
 
107
107
  This will produce HTML like:
108
+
108
109
  ```html
109
110
  <div class="highlight"><pre class="highlight ruby custom-class special"><code>...</code></pre></div>
110
111
  ```
@@ -125,7 +126,7 @@ And then include it in your layout or specific page by:
125
126
  <%= stylesheet_link_tag "highlighting" %>
126
127
  ```
127
128
 
128
- If you want to include this in a larger Sass stylesheet, include it in your main stylesheet with `@import 'highlighting.css'`).
129
+ If you want to include this in a larger Sass stylesheet, include it in your main stylesheet with `@import 'highlighting.css'`.
129
130
 
130
131
  Rouge has `ThankfulEyes`, `Colorful`, `Github`, `Base16`, `Base16::Solarized`, `Base16::Monokai`, and `Monokai` themes.
131
132
 
@@ -232,9 +233,4 @@ The best way to get quick responses to your issues and swift fixes to your bugs
232
233
 
233
234
  ## License
234
235
 
235
- Copyright (c) 2012-2014 Benjamin Hollis. MIT Licensed, see [LICENSE] for details.
236
-
237
- [middleman]: http://middlemanapp.com
238
- [gem]: https://rubygems.org/gems/middleman-syntax
239
- [codeclimate]: https://codeclimate.com/github/middleman/middleman-syntax
240
- [LICENSE]: https://github.com/middleman/middleman-syntax/blob/master/LICENSE.md
236
+ Copyright (c) 2012-2014 Benjamin Hollis. MIT Licensed, see [LICENSE](LICENSE.md) for details.
@@ -0,0 +1,19 @@
1
+ Feature: Lexer options configuration
2
+
3
+ Scenario: Lexer options are passed to Rouge lexer
4
+ Given a fixture app "test-app"
5
+ And a file named "config.rb" with:
6
+ """
7
+ activate :syntax, :lexer_options => { :prompt => 'myshell>>>' }
8
+ """
9
+ And a file named "source/console_code.html.erb" with:
10
+ """
11
+ <% code("console") do %>
12
+ myshell>>> echo "hello world"
13
+ myshell>>> echo "test"
14
+ <% end %>
15
+ """
16
+ And the Server is running
17
+ When I go to "/console_code.html"
18
+ Then I should see '<span class="gp">myshell&gt;&gt;&gt;</span>'
19
+ And I should not see '<span class="o">&gt;&gt;</span>'
@@ -2,3 +2,13 @@
2
2
  Then(/^I should not see line numbers markup$/) do
3
3
  expect(page).not_to have_selector("pre.lineno")
4
4
  end
5
+
6
+ # step definition for testing that specific content is not present
7
+ Then(/^I should not see "([^"]*)"$/) do |content|
8
+ expect(page.body).not_to include(content)
9
+ end
10
+
11
+ # step definition for testing that specific content is not present (new format)
12
+ Then('I should not see {string}') do |content|
13
+ expect(page.body).not_to include(content)
14
+ end
@@ -7,14 +7,15 @@ module Middleman
7
7
 
8
8
  # A helper module for highlighting code
9
9
  def self.highlight(code, language=nil, opts={})
10
- lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::PlainText
11
-
12
10
  highlighter_options = options.to_h.merge(opts)
13
- highlighter_options[:css_class] = [ highlighter_options[:css_class], lexer.tag ].join(' ')
14
11
  lexer_options = highlighter_options.delete(:lexer_options)
12
+
13
+ lexer = Rouge::Lexer.find_fancy(language, code, lexer_options) || Rouge::Lexers::PlainText
14
+
15
+ highlighter_options[:css_class] = [ highlighter_options[:css_class], lexer.tag ].join(' ')
15
16
 
16
17
  formatter = Middleman::Syntax::Formatters::HTML.new(highlighter_options)
17
- formatter.format(lexer.lex(code, lexer_options))
18
+ formatter.format(lexer.lex(code))
18
19
  end
19
20
  end
20
21
  end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Syntax
3
- VERSION = "3.5.0"
3
+ VERSION = "3.6.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hollis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-07 00:00:00.000000000 Z
11
+ date: 2025-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -56,6 +56,7 @@ files:
56
56
  - features/extra_css_classes.feature
57
57
  - features/haml_filter.feature
58
58
  - features/helper.feature
59
+ - features/lexer_options.feature
59
60
  - features/markdown.feature
60
61
  - features/markdown_line_numbers_disabled.feature
61
62
  - features/markdown_line_numbers_enabled.feature
@@ -100,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
101
  - !ruby/object:Gem::Version
101
102
  version: '0'
102
103
  requirements: []
103
- rubygems_version: 3.4.10
104
+ rubygems_version: 3.5.16
104
105
  signing_key:
105
106
  specification_version: 4
106
107
  summary: Code syntax highlighting plugin via rouge for Middleman
@@ -108,6 +109,7 @@ test_files:
108
109
  - features/extra_css_classes.feature
109
110
  - features/haml_filter.feature
110
111
  - features/helper.feature
112
+ - features/lexer_options.feature
111
113
  - features/markdown.feature
112
114
  - features/markdown_line_numbers_disabled.feature
113
115
  - features/markdown_line_numbers_enabled.feature