richer_text 0.2.0 → 0.3.0

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: 8ab9e5f516632d096522a7aa18daaad74e8c6b2eb5736bce0aff526e49a6f5a0
4
- data.tar.gz: 532ff98188ba2b2425188cfcbec7cf80d5563d65339c7a247fdebb41d418247a
3
+ metadata.gz: 4015b9a354c480f94ac845846dc9fdee7d4f9402f42175ebe8080ce2b0e66d87
4
+ data.tar.gz: 4ee8d41ce6076773f86d2703cac148fb41f8a98cdf0feedfc0da0e584575245d
5
5
  SHA512:
6
- metadata.gz: 39981e09d8ce208402c1c66a1541a706af868ad1563d4497b5d919a452256da00308448a6c08a5751f5cebc4b1613c165a2c0ec4d9302a8356a0f33f27f653db
7
- data.tar.gz: 5ea9229f6bfd06ab525ab96b543dc63eed8dcbd34b3419f2dda0fe1058dba8168d881e29871917916ba1b03be7b7d7372da1b233f7c37018528f7c867383d4a6
6
+ metadata.gz: 8cfe5f6dc39db89cc2327a40aa0d4198b1785850cd2dd1d1f11a2fa941dea3a68cd771a8f40295c6f8ba8f6c6a0752ab9aa43382dc19fbd3a2261693bd5a27e9
7
+ data.tar.gz: 5beab5c3cd4e36867b8d302f2cc3a08221dc739d2ab9f3812adf59f06ff1541faacd99be07947b0315f648e1bf0cfb469c3dfd1c4df5c9ac8af3551c58b6c75c
@@ -0,0 +1,32 @@
1
+ .richer-text table {
2
+ border-collapse: collapse;
3
+ margin: 0;
4
+ overflow: hidden;
5
+ table-layout: fixed;
6
+ width: 100%;
7
+ }
8
+
9
+ .richer-text table td,
10
+ .richer-text table th {
11
+ border: 2px solid #ced4da;
12
+ box-sizing: border-box;
13
+ min-width: 1em;
14
+ padding: 3px 5px;
15
+ position: relative;
16
+ vertical-align: top;
17
+ }
18
+
19
+ .richer-text table td>*,
20
+ .richer-text table th>* {
21
+ margin-bottom: 0;
22
+ }
23
+
24
+ .richer-text table th {
25
+ background-color: #f1f3f5;
26
+ font-weight: bold;
27
+ text-align: left;
28
+ }
29
+
30
+ .richer-text p {
31
+ margin: 0;
32
+ }
@@ -1,3 +1,3 @@
1
1
  <div class="richer-text">
2
- <%= sanitize(content.to_html, attributes: %w(id class style data-color)) %>
2
+ <%= sanitize(content.to_html, tags: %w(div h1 h2 blockquote s del strong i em br pre code ol ul li table tbody th td tr p), attributes: %w(id class style data-color colspan rowspan)) %>
3
3
  </div>
@@ -14,6 +14,11 @@ module RicherText
14
14
  "app/views/richer_text/contents/_content.html.erb",
15
15
  "app/views/richer_text/contents/_content.html.erb"
16
16
  )
17
+
18
+ copy_file(
19
+ "app/assets/stylesheets/richer_text/richer-text.css",
20
+ "app/assets/stylesheets/richer-text.css"
21
+ )
17
22
  end
18
23
 
19
24
  def install_javascript_dependencies
@@ -33,7 +38,10 @@ module RicherText
33
38
 
34
39
  if destination.join("app/assets/stylesheets/application.tailwind.css").exist?
35
40
  say "Adding import to application.tailwind.css", :green
36
- prepend_to_file "app/assets/stylesheets/application.tailwind.css", %(@import "@afomera/richer-text/dist/css/richer-text.css";\n@import "highlight.js/styles/github-dark.css";\n)
41
+ prepend_to_file "app/assets/stylesheets/application.tailwind.css", %(@import "@afomera/richer-text/dist/css/richer-text.css";\n@import "highlight.js/styles/github-dark.css";\n@import "richer-text.css";\n)
42
+ elsif (stylesheets = Dir.glob "#{destination_root}/app/assets/stylesheets/application.*.{scss}").length > 0
43
+ say "Adding import to #{stylesheets.first}", :green
44
+ prepend_to_file stylesheets.first, %(@import "@afomera/richer-text/dist/css/richer-text";\n@import "highlight.js/styles/github-dark";\n@import "richer-text";\n)
37
45
  end
38
46
  end
39
47
 
@@ -1,3 +1,3 @@
1
1
  module RicherText
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richer_text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-29 00:00:00.000000000 Z
11
+ date: 2023-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -36,6 +36,7 @@ files:
36
36
  - Rakefile
37
37
  - app/assets/config/richer_text_manifest.js
38
38
  - app/assets/stylesheets/richer_text/application.css
39
+ - app/assets/stylesheets/richer_text/richer-text.css
39
40
  - app/controllers/richer_text/application_controller.rb
40
41
  - app/helpers/richer_text/application_helper.rb
41
42
  - app/helpers/richer_text/tag_helper.rb