actiontext-syntax-highlighter 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28c5abf9a320e71b38f550c9435230cd7c5fda56ae398c66d8950108a18d7f8e
4
- data.tar.gz: 7b8ffc6db9f3ef39de71bfc40caa0aa02a20d7c949d8a4ac081080a4298ddbc1
3
+ metadata.gz: 26c88ebae2b86c9406ef5eedf6f5a033dc5f04730c0551b71d7b96efd7302871
4
+ data.tar.gz: bad6988fa90441571b0695da9ccce1e4d82a814e354cdbb833a4a56ac62abc57
5
5
  SHA512:
6
- metadata.gz: 7f86913946d78cf17b3255504151dc034c6aed5ab36564979ddf1f367763f030b1f203a56bfb8fc686cd38bc3e8c498a5f823246c6170d462c415f7c229bb7f2
7
- data.tar.gz: ccfe7b1d14110e3101baf503a30d632914587bd212a1d8598086d9aa5c16b67a43f29151979f3212f1eaff1658342d2a4c2d2d3dc3ebede8d534909f4d2a6bb9
6
+ metadata.gz: de45feb3f4f9474255e1cb180d0ab032a071d9a15efc343f5ac21061b7423644de2767cd92b2e90cb53b2693a734d25741b62ee19365811125e18d98d717f2ca
7
+ data.tar.gz: 62375406c87222ce9fa398d6d53cb1adf9ed52b1e32da0e2a019e499377e7d76f6d43a602d6b521f1b053d059de1c5195fcb5a3d640c3ac5c2d2ba06fe77d766
data/README.md CHANGED
@@ -1,10 +1,13 @@
1
+ <img width="861" alt="screenshot" src="https://user-images.githubusercontent.com/4924039/120343433-9f91bc80-c2f0-11eb-876b-bcb0a977a020.png">
2
+
3
+
1
4
  # Description
2
5
 
3
6
  `actiontext-syntax-highlighter` is an extension for `rails/actiontext` to allow the user to add language specified code blocks that are then highlighted on the server using [Rouge](http://github.com/rouge-ruby/rouge).
4
7
 
5
8
  [**Check out the demo app to see how it works!**](https://actiontext-syntax-highlighter.herokuapp.com).
6
9
 
7
- > Note: The experience is a bit flaky, especially on Safari. If you have any suggestions for how to improve it, please file an issue; or even better, open a Pull Request!
10
+ > Note: The experience is a bit flaky, especially on Safari. If you have any suggestions for how to improve it, please file an issue; or even better, open a Pull Request! I recommend using Firefox to test this out as that's where it works best!
8
11
 
9
12
  ## How it works
10
13
 
@@ -29,6 +29,7 @@ figure[data-trix-mutable][data-trix-highlighted-code-block] pre {
29
29
  }
30
30
 
31
31
  figure[data-trix-highlighted-code-block] {
32
+ display: block;
32
33
  width: 100%;
33
34
  }
34
35
 
@@ -1,4 +1,5 @@
1
1
  <% @highlighted_code_block_theme ||= ActionTextSyntaxHighlighter.default_theme %>
2
2
  <%= tag.pre highlighted_code_block.highlighted_content, data: {
3
- theme: @highlighted_code_block_theme
3
+ theme: @highlighted_code_block_theme,
4
+ language: highlighted_code_block.language.downcase.presence
4
5
  } %>
@@ -11,6 +11,7 @@ module ActionTextSyntaxHighlighter
11
11
  initializer "action_text_syntax_highlighter.allow_theme_attribute" do
12
12
  Rails.application.config.to_prepare do
13
13
  ActionText::ContentHelper.allowed_attributes << "data-theme"
14
+ ActionText::ContentHelper.allowed_attributes << "data-language"
14
15
  end
15
16
  end
16
17
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionTextSyntaxHighlighter
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actiontext-syntax-highlighter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayush Newatia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-01 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails