jekyll-webawesome 0.5.0 → 0.5.1

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: e958cd124d7cb081e95cc61a14db48b6c0059daa49fef318c452a3cab30fecfb
4
- data.tar.gz: b531b0aa50c859837a7500fbdb45d0c46dc0c936163b139715592b60fc3b05c5
3
+ metadata.gz: 5f88821b94fa1042ddd81efc46e15e35eb4b0c53f1159ccba1f92f171bf3b498
4
+ data.tar.gz: a10ad10f3477bbbe7da32eab5b9faaab0ef202e94aa6369ee28936ae52017d19
5
5
  SHA512:
6
- metadata.gz: 042c0a994e97c359c06edf42103fd0308bcab11f9c241b43e402fdae0bb0176ce72ab30e371a0d521fda3149245187c92447e201e0073b219573d649260c187a
7
- data.tar.gz: f44d6a009eee1d5f2b807bb2fdcc858d2372646a3900165f42d2c6c7dd0eaa7ad2b30d506d63f95ed3de9f47c130ea6a4b2f9560ff8ee7f2e95eea165508e70b
6
+ metadata.gz: 78af1fefc803ab19f6da488775df860d49c0f7855afdec3ed9e2a8794b5e4261914bbd169ad275be7094a8aa10656c36c0ce6a3db88021544ffd6e7b81b2c47f
7
+ data.tar.gz: 9bb145b074f07b779f0fec449d3b24c2c7727a7fd55e9cdeb1697460a8d0214bf6052d84ce0a2686a0b4e2c83264c1a0137cfdb71e20eef204d4d6febfe7cf5d
data/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
8
8
 
9
9
  - Placeholder
10
10
 
11
+ ## [0.5.1] - 2025-10-20
12
+
13
+ - Image dialog auto-transformation feature fix: protect comparison components
14
+
11
15
  ## [0.5.0] - 2025-10-20
12
16
 
13
17
  - Add support for wa-dialog component
@@ -10,8 +10,9 @@ module Jekyll
10
10
  # Example: ![Alt text](image.png "nodialog")
11
11
  class ImageDialogTransformer < BaseTransformer
12
12
  def self.transform(content)
13
- # First, protect inline code blocks from transformation
13
+ # First, protect inline code blocks and comparison blocks from transformation
14
14
  protected_content, code_blocks = protect_inline_code(content)
15
+ protected_content, comparison_blocks = protect_comparisons(protected_content)
15
16
 
16
17
  # Match markdown images: ![alt](url) or ![alt](url "title")
17
18
  # Capture alt text, URL, and optional title
@@ -33,7 +34,8 @@ module Jekyll
33
34
  end
34
35
  end
35
36
 
36
- # Restore protected inline code
37
+ # Restore protected comparison blocks first, then inline code
38
+ result = restore_comparisons(result, comparison_blocks)
37
39
  restore_inline_code(result, code_blocks)
38
40
  end
39
41
 
@@ -59,6 +61,26 @@ module Jekyll
59
61
  content
60
62
  end
61
63
 
64
+ # Protect comparison blocks from image transformation
65
+ def protect_comparisons(content)
66
+ comparison_blocks = []
67
+ # Match comparison blocks: <wa-comparison ...>...</wa-comparison>
68
+ protected = content.gsub(/<wa-comparison[^>]*>.*?<\/wa-comparison>/m) do |match|
69
+ placeholder = "COMPARISON_BLOCK_#{comparison_blocks.length}"
70
+ comparison_blocks << match
71
+ placeholder
72
+ end
73
+ [protected, comparison_blocks]
74
+ end
75
+
76
+ # Restore protected comparison blocks
77
+ def restore_comparisons(content, comparison_blocks)
78
+ comparison_blocks.each_with_index do |block, index|
79
+ content = content.gsub("COMPARISON_BLOCK_#{index}", block)
80
+ end
81
+ content
82
+ end
83
+
62
84
  # Transform image into our custom dialog syntax
63
85
  # This will be processed by DialogTransformer to create the actual wa-dialog
64
86
  def transform_to_dialog(alt_text, image_url, title)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module WebAwesome
5
- VERSION = '0.5.0'
5
+ VERSION = '0.5.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-webawesome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janne Waren