jekyll-koziolekweb-deorphanter 0.1.2 → 0.2.0

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: c7f724fb02af4c3f62c1e4a04ba31e68dbf0694dc48cea5af725e389197bdcd6
4
- data.tar.gz: eb4e435ada50ddb423c0d4272fa051d9069ffa4fc6dd736f52627b0963314f38
3
+ metadata.gz: b754ff78635e182af4220f5a898db4f129feddaf73e1f757b77f459f1981718f
4
+ data.tar.gz: b132fd13d15ef1f3364a3582fbc3dacb4d7a94443c65026bbabe8390ae142390
5
5
  SHA512:
6
- metadata.gz: 52e661f1dffd3e668903e987204ef1c7635a09ff410052c8d72aff83dffe0ae8ec9cf427a1c33ba416b67b47e35ad17e74dfd69f012e966976c6707421d4fb25
7
- data.tar.gz: 2964ad3d5e5f60c095300f5be3395b1fadb1ff51a4d0c0af90fa8f138c4539250e5775cd4c7f77c1ef80d0fd42c13f550d4e84d8c7917c14f1633b0761833bf4
6
+ metadata.gz: 225c4c56a57b60319c8f56ea15370a1d8dfcfad589337cbd064b74dc2a2ced0d66573fe6a05c18db4d9499d566ff1b26bf66de587f19cdc8b03abb158e7f4b2d
7
+ data.tar.gz: fa517f73ced442ca37a31895ef4eb2c493463ddb33590b08185f2b35596637fccbe7bc1ee43fc50ff7cbd679e5885c182e5372b1d8216d9025f676fe208bcf73
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+
2
+ ## 2025-07-13
3
+ - a5692fa [2025-07-13] initial version (Koziolek)
4
+
5
+ ## 2025-07-13
6
+ - a5692fa [2025-07-13] initial version (Koziolek)
7
+
8
+ ## 2025-07-13
9
+ - a5692fa [2025-07-13] initial version (Koziolek)
@@ -3,7 +3,7 @@
3
3
  module Jekyll
4
4
  module Koziolekweb
5
5
  module Deorphanter
6
- VERSION = "0.1.2"
6
+ VERSION = "0.2.0"
7
7
  end
8
8
  end
9
9
  end
@@ -4,11 +4,32 @@ require_relative "deorphanter/version"
4
4
 
5
5
  module Koziolekweb
6
6
  module Deorphanter
7
+
8
+ SINGLE_LETTER = /\b([a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ\-–])\b(?:\s|$)/
9
+ REPLACE = '\1 '
10
+ BLOCK_REGEX = /```.*?```/m.freeze
11
+
12
+ # Metoda zastępująca pojedyncze litery przekształcone w ` `
7
13
  def self.replace_single_letter_spaces(content)
8
14
  return content unless content && content.is_a?(String)
9
- content.gsub(/\b([a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ\-–])\b(?:\s|$)/, '\1 ')
15
+
16
+ chunks = []
17
+ # Podział treści na części (wewnątrz bloków kodu i poza nimi)
18
+ content.split(BLOCK_REGEX).each_with_index do |chunk, index|
19
+ chunk = chunk.gsub(SINGLE_LETTER, REPLACE)
20
+ chunks << chunk
21
+ end
22
+
23
+ # Wstawianie nieruszonych bloków kodu z powrotem na swoje miejsca
24
+ content.scan(BLOCK_REGEX).each_with_index do |code_block, i|
25
+ chunks.insert(2 * i + 1, code_block)
26
+ end
27
+
28
+ chunks.join
10
29
  end
11
30
 
31
+
32
+
12
33
  def self.apply_hook_to(document)
13
34
  document.content = replace_single_letter_spaces(document.content)
14
35
  end
@@ -0,0 +1,7 @@
1
+ module Koziolekweb
2
+ module Deorphanter
3
+ BLOCK_REGEX: Regexp
4
+ REPLACE: string
5
+ SINGLE_LETTER: Regexp
6
+ end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-koziolekweb-deorphanter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koziolek
@@ -37,6 +37,7 @@ executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []
39
39
  files:
40
+ - CHANGELOG.md
40
41
  - LICENSE.txt
41
42
  - README.md
42
43
  - Rakefile
@@ -44,6 +45,7 @@ files:
44
45
  - lib/jekyll/koziolekweb/deorphanter.rb
45
46
  - lib/jekyll/koziolekweb/deorphanter/version.rb
46
47
  - sig/jekyll/koziolekweb/deorphanter.rbs
48
+ - sig/koziolekweb/deorphanter.rbs
47
49
  homepage: https://github.com/Koziolek/jekyll-koziolekweb-deorphanter
48
50
  licenses:
49
51
  - MIT