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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f88821b94fa1042ddd81efc46e15e35eb4b0c53f1159ccba1f92f171bf3b498
|
4
|
+
data.tar.gz: a10ad10f3477bbbe7da32eab5b9faaab0ef202e94aa6369ee28936ae52017d19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: 
|
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:  or 
|
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)
|