markly 0.3.0 → 0.4.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: 283b4451a31b54fd8980429243597bbc5a26078ad7c07725bc0b896135cffce2
4
- data.tar.gz: 39eb765425f8b2c8c4fa3d37b28be5205ef74da5c6eaf918fb6c4963f69dd038
3
+ metadata.gz: 770b81ed57426a591eaa4335ad913df94f61017e08f5e19872766e59ec3d33db
4
+ data.tar.gz: 45f5295c1fae1747c841a85b8f17f1442d47ad91194a38874e1313e8c95313f4
5
5
  SHA512:
6
- metadata.gz: c8a8d80c4681e24dc93e51578eaf80d806597273466cf4e531fe60a272d55a9dca80458f9e584284f5614b5acda572ab375b3d5ff4f9d19d45aa0e49133a7d07
7
- data.tar.gz: 663fd425405eb11fd6c17ab3ea367a81a5779317012195994878434cfe72d137dddb935dab22eb0bc773f39924a8833a91d04bb5fb57e758388ca1d9be367ea8
6
+ metadata.gz: 75bdb5b83d6ca7685fb659d27f45bfaaefe1241f306ec21281bbbd5906612663c8e4ba7ad3abf59069ff6501c72933c6770d09176dd119de946e5baea0b826ff
7
+ data.tar.gz: 0c0aa153efcbbb7914a805e52bf80fdda4bdc5d1ddb0352f7bb00c334f2730d8cd342a19fa273082c07597c16166c666b8f86be66a197729f902e0539903af8f
@@ -47,6 +47,8 @@ static void rb_Markly_Node_free(void *data) {
47
47
 
48
48
  if (cmark_node_parent(node) == NULL) {
49
49
  cmark_node_free(node);
50
+ } else {
51
+ cmark_node_set_user_data(node, NULL);
50
52
  }
51
53
  }
52
54
  }
@@ -329,10 +331,10 @@ static VALUE rb_node_set_string_content(VALUE self, VALUE s) {
329
331
  * Returns a {Symbol} representing the node's type.
330
332
  */
331
333
  static VALUE rb_node_get_type(VALUE self) {
332
- int node_type;
333
- cmark_node *node;
334
- VALUE symbol;
335
- const char *s;
334
+ int node_type = 0;
335
+ cmark_node *node = NULL;
336
+ VALUE symbol = NULL;
337
+ const char *s = NULL;
336
338
 
337
339
  TypedData_Get_Struct(self, cmark_node, &rb_Markly_Node_Type, node);
338
340
 
Binary file
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cgi'
4
+
3
5
  module Markly
4
6
  class HTMLRenderer < Renderer
5
7
  def initialize(ids: false, **options)
@@ -17,7 +19,7 @@ module Markly
17
19
  if @ids
18
20
  id = node.to_plaintext.chomp.downcase.gsub(/\s+/, '-')
19
21
 
20
- return " id=\"#{id}\""
22
+ return " id=\"#{CGI.escape_html id}\""
21
23
  end
22
24
  end
23
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Markly
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-06-17 00:00:00.000000000 Z
13
+ date: 2020-07-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bake
@@ -150,7 +150,7 @@ files:
150
150
  - ext/markly/xml.c
151
151
  - lib/markly.rb
152
152
  - lib/markly/flags.rb
153
- - lib/markly/markly.so
153
+ - lib/markly/markly.bundle
154
154
  - lib/markly/node.rb
155
155
  - lib/markly/node/inspect.rb
156
156
  - lib/markly/renderer.rb
Binary file