collapsible_section 0.1.0 → 0.1.2
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +9 -14
- data/lib/collapsible_section/helper.rb +4 -2
- data/lib/collapsible_section/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d8fea31cac021d56b926b0c3febc46ba967cf183208e19ec78c2048ae7c5d58
|
4
|
+
data.tar.gz: ff5ac97b8ebbd1ac56a2fb78ce131852c55d00cb38432109a70f4724f5d22b27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1153527ffc6d8e97d43af886681280a7deeb4755798dc8f6a1698a0b64b2a4f78986110c9c03ca8324724e2112aa60f56ce78623659d546f5a4bdebe5f3b7afa
|
7
|
+
data.tar.gz: e1fe51aa2ef20aca36767278e98714d5f81d1c5fadd6c60e893fc3ece38508171837317d8a7f55076f2d5c09f721f4a11571f51718af5f0574bb7184a96e6811
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.2] - 2025-08-04
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Fixed HTML content escaping issue within collapsible sections where block content was being double-escaped
|
8
|
+
|
9
|
+
## [0.1.1] - 2025-08-04
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
- Fixed HTML escaping issue where generated HTML was being escaped as text instead of rendered as proper HTML elements
|
14
|
+
|
3
15
|
## [0.1.0] - 2025-07-20
|
4
16
|
|
5
17
|
- Initial release
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A Rails gem that provides a simple helper method to generate HTML5 `<details>` c
|
|
7
7
|
Add to Gemfile:
|
8
8
|
|
9
9
|
```Gemfile
|
10
|
-
gem 'collapsible_section', '~> 0.1.
|
10
|
+
gem 'collapsible_section', '~> 0.1.2'
|
11
11
|
```
|
12
12
|
|
13
13
|
After building and installing the gem, replace your selected code with:
|
@@ -29,33 +29,28 @@ This will generate the same HTML structure but through a reusable gem component:
|
|
29
29
|
|
30
30
|
## Installation
|
31
31
|
|
32
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
33
|
-
|
34
32
|
Install the gem and add to the application's Gemfile by executing:
|
35
33
|
|
36
34
|
```bash
|
37
|
-
bundle add
|
35
|
+
bundle add collapsible_section
|
38
36
|
```
|
39
37
|
|
40
38
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
41
39
|
|
42
40
|
```bash
|
43
|
-
gem install
|
41
|
+
gem install collapsible_section
|
44
42
|
```
|
45
43
|
|
46
|
-
## Usage
|
47
|
-
|
48
|
-
TODO: Write usage instructions here
|
49
|
-
|
50
44
|
## Development
|
51
45
|
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
```bash
|
47
|
+
gem build collapsible_section.gemspec
|
48
|
+
gem push collapsible_section-0.1.2.gem
|
49
|
+
```
|
55
50
|
|
56
51
|
## Contributing
|
57
52
|
|
58
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
53
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yaroslavrick/collapsible_section. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/yaroslavrick/collapsible_section/blob/main/CODE_OF_CONDUCT.md).
|
59
54
|
|
60
55
|
## License
|
61
56
|
|
@@ -63,4 +58,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
63
58
|
|
64
59
|
## Code of Conduct
|
65
60
|
|
66
|
-
Everyone interacting in the CollapsibleSection project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
61
|
+
Everyone interacting in the CollapsibleSection project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yaroslavrick/collapsible_section/blob/main/CODE_OF_CONDUCT.md).
|
@@ -5,8 +5,10 @@ module CollapsibleSection
|
|
5
5
|
def collapsible_section(title, open: true, &block)
|
6
6
|
content_tag(:details, class: "section-collapsable", open: open) do
|
7
7
|
summary_content = content_tag(:h3, title, class: "section-title")
|
8
|
-
|
9
|
-
|
8
|
+
summary_tag = content_tag(:summary, summary_content, class: "section-header")
|
9
|
+
block_content = block_given? ? capture(&block) : ""
|
10
|
+
|
11
|
+
(summary_tag + block_content).html_safe
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|