apex-ruby 1.0.37 → 1.0.38

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: 70423c8b7b3f13723cfee24afc52bbf12c049950b241aee21e8f53dc3b971f4f
4
- data.tar.gz: 1ea75f8a208a30aa92d886b4435d6bf246dbecb1d5fe627e87c3f211dcb9f656
3
+ metadata.gz: ae9f539a2b1544d0df515de411fde4d0f3aeb30ab7ca7b6f479b11aebf7ffad9
4
+ data.tar.gz: cc8bbde52b5809eed92e053ba83f036ebd0165359f66b2948cda19d0302a49f9
5
5
  SHA512:
6
- metadata.gz: 35f0ff23c943b29e0cc7d73fd75a8d28304a7e8bcaf490705c60dcbfe97096b2357174e77270ec00abfda417a8f9dfc0d863682e56468619f40b1275d7eb7e80
7
- data.tar.gz: 0aa1da7ad8a6d607b1b54467e25ef386e644a653221d2cf01abf7a0455571d6607340cb19b143ae718344ec2ce660ddf9480155cc0be5cfb3ee198b9913f6e99
6
+ metadata.gz: d249897d7cb049c2e2321d9eb611c7e7130b72c3a1d3eab7a9397b78d70de1c142cf149056ef15bb55ebe6748d1102f0e5cea56ce3343db7db0edac19848fc30
7
+ data.tar.gz: 5806b9b11104918b2f115f557cb032a339b03017375b08cb4ce15168ed0886837500b6aec2deedd2aaf15af45abfacf40cc5df93a7cabdbe2b8033c9b6579ac1
@@ -21,8 +21,8 @@ typedef struct cmark_node cmark_node;
21
21
 
22
22
  #define APEX_VERSION_MAJOR 1
23
23
  #define APEX_VERSION_MINOR 1
24
- #define APEX_VERSION_PATCH 39
25
- #define APEX_VERSION_STRING "1.1.39"
24
+ #define APEX_VERSION_PATCH 40
25
+ #define APEX_VERSION_STRING "1.1.40"
26
26
 
27
27
  /**
28
28
  * Processor compatibility modes
@@ -470,7 +470,9 @@ static void collect_nodes_with_attrs_recursive(cmark_node *node, attr_node **lis
470
470
  /* Increment counter for this element type */
471
471
  int elem_idx = -1;
472
472
  if (type == CMARK_NODE_PARAGRAPH) elem_idx = counters->para_count++;
473
- else if (type >= CMARK_NODE_HEADING && type <= CMARK_NODE_HEADING + 5) elem_idx = counters->heading_count++;
473
+ /* One node type for every heading level. HEADING+1..+5 are thematic
474
+ * breaks, footnotes, and the GFM table nodes, not h2-h6. */
475
+ else if (type == CMARK_NODE_HEADING) elem_idx = counters->heading_count++;
474
476
  else if (type == CMARK_NODE_TABLE) {
475
477
  /* For tables, increment the counter first, then use (count - 1) as the index */
476
478
  /* This ensures the index matches the HTML renderer's count of <table> tags */
@@ -655,8 +657,7 @@ char *apex_render_html_with_attributes(cmark_node *document, int options) {
655
657
  for (attr_node *a = attr_list; a; a = a->next, check_idx++) {
656
658
  /* Check by element type and index for removal */
657
659
  if (!used[check_idx] &&
658
- (a->node_type == elem_type ||
659
- (elem_type == CMARK_NODE_HEADING && a->node_type >= CMARK_NODE_HEADING && a->node_type <= CMARK_NODE_HEADING + 5)) &&
660
+ a->node_type == elem_type &&
660
661
  a->element_index == elem_idx) {
661
662
  if (strstr(a->attrs, "data-remove")) {
662
663
  should_remove = true;
@@ -846,9 +847,7 @@ char *apex_render_html_with_attributes(cmark_node *document, int options) {
846
847
  for (attr_node *a = attr_list; a; a = a->next, idx++) {
847
848
  if (used[idx]) continue;
848
849
 
849
- /* Check type match (including inline elements) */
850
- bool type_match = (a->node_type == elem_type ||
851
- (elem_type == CMARK_NODE_HEADING && a->node_type >= CMARK_NODE_HEADING && a->node_type <= CMARK_NODE_HEADING + 5));
850
+ bool type_match = (a->node_type == elem_type);
852
851
 
853
852
  if (!type_match) continue;
854
853
 
data/lib/apex/version.rb CHANGED
@@ -6,7 +6,7 @@ module Apex
6
6
  # via Apex::Native.version.
7
7
  module Version
8
8
  # Current gem version.
9
- VERSION = "1.0.37"
9
+ VERSION = "1.0.38"
10
10
  end
11
11
 
12
12
  # Shortcut to gem version string.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apex-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.37
4
+ version: 1.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra