marked-conductor 1.0.28 → 1.0.29

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: 333d82d6ed153da7c528506348ac3faff3852fef0614f0009bbcc0a963907a7f
4
- data.tar.gz: c24154363d7035cc4bcd1539abe117276f1955231fa0f7af27f49678164cf1db
3
+ metadata.gz: 25fca33d78a755b6ab7b9dc4003d842723ca9b1a5eabb4357f665f91480e08cc
4
+ data.tar.gz: b75c35f4db0f8d96a8a62e7636ff3f268918f85aa98fd133d30621c16dc58ce1
5
5
  SHA512:
6
- metadata.gz: 323227fde6789d933d412afe287a9784c18ac2610e2d50e5050c14840b8045ce9c2b380fe714aa658c009eaa7dd038b6a6d88f0f648719f4dcd5f0958a862ef2
7
- data.tar.gz: ebdef901d6a9407adb9cfeb7412f0a21ac01eeeb89f38593556269594e58d32737cf426849d74a9f485e9d865646bbafa16a6b5c25430ed4f98391139d5265e7
6
+ metadata.gz: 4bdd6b152729410fbd5f6752672169a41cdeab264f9b21ae8796eced90dcff3334817dd51038f8732ff6e9d5856776872b3d9cdcaf87898a74c405e8ce99a3a7
7
+ data.tar.gz: f26b8b7c39db572313b95b83fce5ac49cbd950171034a1bc99a092c62cc0104b1d28eb78e3dbdfa4c44bd1f54f90a4c0d79e0ea9173020fcc4e7e1ab1131eb0f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.0.29
2
+
3
+ 2024-07-28 09:57
4
+
5
+ #### NEW
6
+
7
+ - Increase/decreaseHeaders(count) filter
8
+
1
9
  ### 1.0.28
2
10
 
3
11
  2024-07-27 14:54
data/README.md CHANGED
@@ -167,6 +167,8 @@ The action can be `script`, `command`, or `filter`.
167
167
  | `insertCSS(path)` | insert custom CSS into document |
168
168
  | `autoLink()` | Turn bare URLs into \<self-linked\> urls |
169
169
  | `fixHeaders()` | Reorganize headline levels to semantic order |
170
+ | `increaseHeaders(count) | Increase header levels by count (default 1) |
171
+ | `decreaseHeaders(count) | Decrease header levels by count (default 1) |
170
172
 
171
173
  For `replace` and `replaceAll`: If *search* is surrounded with forward slashes followed by optional flags (*i* for case-insensitive, *m* to make dot match newlines), e.g. `/contribut(ing)?/i`, it will be interpreted as a regular expression. The *replace* value can include numeric capture groups, e.g. `Follow$2`.
172
174
 
@@ -135,7 +135,7 @@ class ::String
135
135
  ## @param amt [Integer] The amount to decrease
136
136
  ##
137
137
  def decrease_headers(amt = 1)
138
- gsub(/^(\#{1,6})(?!=#)/) do
138
+ normalize_headers.gsub(/^(\#{1,6})(?!=#)/) do
139
139
  m = Regexp.last_match
140
140
  level = m[1].size
141
141
  level -= amt
@@ -152,7 +152,7 @@ class ::String
152
152
  ## @return [String] content with headers increased
153
153
  ##
154
154
  def increase_headers(amt = 1)
155
- gsub(/^#/, "#{"#" * amt}#").gsub(/^\#{7,}/, "######")
155
+ normalize_headers.gsub(/^#/, "#{"#" * amt}#").gsub(/^\#{7,}/, "######")
156
156
  end
157
157
 
158
158
  ##
@@ -764,6 +764,9 @@ module Conductor
764
764
  content.autolink
765
765
  when /fix(head(lines|ers)|hierarchy)/
766
766
  content.fix_hierarchy
767
+ when /(increase|decrease)headers/
768
+ count = @params ? @params[0].to_i : 1
769
+ @filter =~ /^inc/ ? content.increase_headers(count) : content.decrease_headers(count)
767
770
  else
768
771
  content
769
772
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conductor
4
- VERSION = "1.0.28"
4
+ VERSION = '1.0.29'
5
5
  end
data/src/_README.md CHANGED
@@ -167,6 +167,8 @@ The action can be `script`, `command`, or `filter`.
167
167
  | `insertCSS(path)` | insert custom CSS into document |
168
168
  | `autoLink()` | Turn bare URLs into \<self-linked\> urls |
169
169
  | `fixHeaders()` | Reorganize headline levels to semantic order |
170
+ | `increaseHeaders(count) | Increase header levels by count (default 1) |
171
+ | `decreaseHeaders(count) | Decrease header levels by count (default 1) |
170
172
 
171
173
  For `replace` and `replaceAll`: If *search* is surrounded with forward slashes followed by optional flags (*i* for case-insensitive, *m* to make dot match newlines), e.g. `/contribut(ing)?/i`, it will be interpreted as a regular expression. The *replace* value can include numeric capture groups, e.g. `Follow$2`.
172
174
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marked-conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.28
4
+ version: 1.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-27 00:00:00.000000000 Z
11
+ date: 2024-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print