redcarpet-form-extension 0.1.0 → 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: e53e6b979993e1025392b3f55e0c17ee6d33d9023812ff8f5ce9e92a6b105d8f
4
- data.tar.gz: d7326bc8df6b1e0be9f8d77bbdfdc3170a05e7aac3c8161cd1a37fa509634e89
3
+ metadata.gz: '04784500442b55459e454027f39baf7db8ebf23078bf21ff27f0435330a0df23'
4
+ data.tar.gz: 4aab43096cb5d4c9783036bcd02497223858964d46339523784ab8760972d80e
5
5
  SHA512:
6
- metadata.gz: 491b0f555c8de7cfb3d11f9ff36c84eacd2f3b4e1115bf2a61a134256e927c8af1d2ed55b791768a41feccba34514870c9535685ee22aa10c8800daa84f3a8ec
7
- data.tar.gz: a8f5f8e25af3791b33e7377aa0ed170cae6898850a8992ff3bd66b4f18c114706cb7deefec9d487de9b8754999aac633e3df14d5c9833250d4e92a0a3a095077
6
+ metadata.gz: 9f0487ef8559826e785571798d309a02446c5388d3ff178621919c92a995017f201006485f4e29dae4c1e47293cfb8ae90f88cfcc2d15edf637167f78a481966
7
+ data.tar.gz: 901dfd62ea1bc57a60d9505ecd8516962788f5444e871990c157d4ddf0a512218eedc55cf81fa20d29f2e3ab65f1d2fdea652f8db56525d3e728804eb71e081a
data/Gemfile CHANGED
@@ -24,3 +24,6 @@ gem 'byebug'
24
24
 
25
25
  # Code coverage for Ruby
26
26
  gem 'simplecov', require: false, group: :test
27
+
28
+ # A gem to bump versions of gems and chef-cookbooks.
29
+ gem 'bump'
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redcarpet-form-extension (0.1.0)
4
+ redcarpet-form-extension (0.2.0)
5
5
  redcarpet (~> 3.5.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
+ bump (0.10.0)
11
12
  byebug (11.1.3)
12
13
  diff-lcs (1.5.0)
13
14
  docile (1.4.0)
@@ -61,6 +62,7 @@ PLATFORMS
61
62
  x86_64-linux
62
63
 
63
64
  DEPENDENCIES
65
+ bump
64
66
  byebug
65
67
  rake (~> 12.0)
66
68
  redcarpet-form-extension!
data/README.md CHANGED
@@ -27,16 +27,16 @@ markdown = Redcarpet::Markdown.new(Redcarpet::Form::Extension::Render::HTML)
27
27
 
28
28
  ### Input (inline)
29
29
 
30
- Use the follwoing snap code to add an input tag in your html. By default, tag attributes are `type="text" name=""` but you can use `{}` to pass the attributes you need:
30
+ Use the follwoing snap code to add an input tag in your html. By default, tag attributes are `type="text" name="[random_string]"` but you can use `{}` to pass the attributes you need:
31
31
 
32
32
  ```txt
33
- Some text before ____{ type="number" } and after.
33
+ Some text before [input]{ type="number" } and after.
34
34
  ```
35
35
 
36
36
  Returns:
37
37
 
38
38
  ```html
39
- <input type="number" name="" />
39
+ <input type="number" name="gfkoyl" />
40
40
  ````
41
41
 
42
42
  ### Checkboxes
@@ -44,7 +44,7 @@ Returns:
44
44
  Also, you can create your fieldset of checkboxes:
45
45
 
46
46
  ```text
47
- []{value="bike"} I have a bike [x]{value="car"} I have a car [x]{value="boat"} I have a boat
47
+ []{ value="bike" } I have a bike [x]{ value="car" } I have a car [x]{ value="boat" } I have a boat
48
48
  ```
49
49
 
50
50
  This snap returns the following HTML:
@@ -86,7 +86,7 @@ which will return:
86
86
  Finally, a textarea can be generated using the follwing snap:
87
87
 
88
88
  ```txt
89
- [textarea]{value="Hello world!" rows="4" cols="10"} Text box
89
+ [textarea]{ value="Hello world!" rows="4" cols="10" } Text box
90
90
  ```
91
91
 
92
92
  The HTML result is:
@@ -6,7 +6,7 @@ module Redcarpet
6
6
  module Block
7
7
  # A textarea block
8
8
  #
9
- # Ex: [textarea]{value="Hello world!" rows="4" cols="10"} Text box
9
+ # Ex: [textarea]{ value="Hello world!" rows="4" cols="10" } Text box
10
10
  # <fieldset>
11
11
  # <label>Text box</label>
12
12
  # <textarea name="123456" rows="4" cols="10">
@@ -6,15 +6,15 @@ module Redcarpet
6
6
  module Inline
7
7
  # A single input tag
8
8
  #
9
- # Ex: ____{ type="number" }
9
+ # Ex: [input]{ type="number" }
10
10
  # <input type="number" name="" />
11
11
  class Input
12
12
  def self.pattern
13
- /(____)(\{(.+)\})?/
13
+ /\[input\]([{][^}]*[}])?/
14
14
  end
15
15
 
16
16
  def self.default_attributes
17
- { 'type' => 'text', 'name' => '' }
17
+ { 'type' => 'text', 'name' => Util.random_string }
18
18
  end
19
19
 
20
20
  def self.html(text)
@@ -3,7 +3,7 @@
3
3
  module Redcarpet
4
4
  module Form
5
5
  module Extension
6
- VERSION = '0.1.0'
6
+ VERSION = '0.2.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redcarpet-form-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sofia Sousa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet