redcarpet-form-extension 0.1.3 → 0.3.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: 11312fec7ad1df0858270e89746f1b738e4856e6085a357f7a9aacd0560ad2ff
4
- data.tar.gz: 534980c595765c799c375a78bd28162cdfe17388d5d223b4bf73a71bc0b31355
3
+ metadata.gz: 71c2cdc7a4d88212ac44275523aed5d03b3090b9a06575fdfbcda393d85b953c
4
+ data.tar.gz: b2a5e3bc85878b77431df8d70ae8f0e0185efd3fbb64c100454f430a2717f4ed
5
5
  SHA512:
6
- metadata.gz: b2a3a907394ce2ae818c15845162cf90439e7e573fd0cd13ca076b68da96d221193edfe526363e673703116e42f01856a044493055697dbdb6adf4b95bff63f7
7
- data.tar.gz: a8e5038dbfb8871bb35beaaea1fcd0c3de5f35a8532aeb775361f3a7c0812d582a792c9196ed3b6c86017f3bbdcef9022234f6fe03c6712c680321522e4b0938
6
+ metadata.gz: 1dae0d412f37f7486a67e1bb00e60adb23d7a73e54d613a5424e118c0a296d400232344ba2c0e6ad15429b48c3cfa4c2c922f4867848cc72c3671d1bf7a9205c
7
+ data.tar.gz: cd80b54efb678ce4343243237c0ca6f1e3e75a102a3b134a27e88017d6d80e4258ecab034cec4d9e88e81a673876b2e47e58da6c2a61b62b7c63abcdc814137c
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ### v0.3.0 - 2022-06-15
2
+ ### v0.2.1 - 2022-06-14
3
+ ### v0.2.0 - 2022-06-14
4
+ - feat: Change single input pattern
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redcarpet-form-extension (0.1.3)
4
+ redcarpet-form-extension (0.3.0)
5
5
  redcarpet (~> 3.5.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -27,10 +27,10 @@ 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:
@@ -44,16 +44,16 @@ 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:
51
51
 
52
52
  ```html
53
53
  <fieldset>
54
- <label><input type="checkbox" name="xekiry[]" value="bike" />I have a bike</label>
55
- <label><input type="checkbox" name="xekiry[]" value="car" checked />I have a car</label>
56
- <label><input type="checkbox" name="xekiry[]" value="boat" checked />I have a boat</label>
54
+ <label><input type="checkbox" name="xekiry[]" value="bike" /><span>I have a bike</span></label>
55
+ <label><input type="checkbox" name="xekiry[]" value="car" checked /><span>I have a car</span></label>
56
+ <label><input type="checkbox" name="xekiry[]" value="boat" checked /><span>I have a boat</span></label>
57
57
  </fieldset>
58
58
  ```
59
59
 
@@ -72,9 +72,9 @@ which will return:
72
72
 
73
73
  ```html
74
74
  <fieldset>
75
- <label><input type="radio" name="ybqkvo" value="radio_1" />HTML</label>
76
- <label><input type="radio" name="ybqkvo" value="radio_2" checked />CSS</label>
77
- <label><input type="radio" name="ybqkvo" value="radio_3" />JavaScript</label>
75
+ <label><input type="radio" name="ybqkvo" value="radio_1" /><span>HTML</span></label>
76
+ <label><input type="radio" name="ybqkvo" value="radio_2" checked /><span>CSS</span></label>
77
+ <label><input type="radio" name="ybqkvo" value="radio_3" /><span>JavaScript</span></label>
78
78
  </fieldset>
79
79
  ```
80
80
 
@@ -86,17 +86,17 @@ 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:
93
93
 
94
94
  ```html
95
95
  <fieldset>
96
- <label>Text box</label>
97
- <textarea name="kaatyu" rows="4" cols="10">
98
- Hello world!
99
- </textarea>
96
+ <label>Text box</label>
97
+ <textarea name="kaatyu" rows="4" cols="10">
98
+ Hello world!
99
+ </textarea>
100
100
  </fieldset>
101
101
  ````
102
102
 
data/Rakefile CHANGED
@@ -1,4 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
+ require 'bump/tasks'
5
+
6
+ Bump.tag_by_default = true
7
+ Bump.changelog = true
8
+
4
9
  task default: :spec
@@ -9,9 +9,9 @@ module Redcarpet
9
9
  #
10
10
  # Ex: []{value="bike"} I have a bike [x]{value="car"} I have a car [x]{value="boat"} I have a boat
11
11
  # <fieldset>
12
- # <label><input type="checkbox" name="123456[]" value="bike" />I have a bike</label>
13
- # <label><input type="checkbox" name="123456[]" value="car" checked />I have a car</label>
14
- # <label><input type="checkbox" name="123456[]" value="boat" checked />I have a boat</label>
12
+ # <label><input type="checkbox" name="123456[]" value="bike" /><span>I have a bike</span></label>
13
+ # <label><input type="checkbox" name="123456[]" value="car" checked /><span>I have a car</span></label>
14
+ # <label><input type="checkbox" name="123456[]" value="boat" checked /><span>I have a boat</span></label>
15
15
  # </fieldset>
16
16
  # rubocop:enable Layout/LineLength
17
17
  class Checkboxes
@@ -41,7 +41,7 @@ module Redcarpet
41
41
  html += "<input #{Util.attributes_to_s(attrs)}"
42
42
  html += ' checked' if checked == 'x'
43
43
  html += ' />'
44
- html += "#{label}</label>" unless label.empty?
44
+ html += "<span>#{label}</span></label>" unless label.empty?
45
45
  end
46
46
 
47
47
  html += '</fieldset>'
@@ -8,9 +8,9 @@ module Redcarpet
8
8
  #
9
9
  # Ex: (){value="html"} HTML (x){value="css"} CSS (){value="js"} JavaScript
10
10
  # <fieldset>
11
- # <label><input type="radio" name="123456" value="html" />HTML</label>
12
- # <label><input type="radio" name="123456" value="css" checked />CSS</label>
13
- # <label><input type="radio" name="123456" value="js" />JavaScript</label>
11
+ # <label><input type="radio" name="123456" value="html" /><span>HTML</span></label>
12
+ # <label><input type="radio" name="123456" value="css" checked /><span>CSS</span></label>
13
+ # <label><input type="radio" name="123456" value="js" /><span>JavaScript</span></label>
14
14
  # </fieldset>
15
15
  class RadioButtons
16
16
  def self.pattern
@@ -39,7 +39,7 @@ module Redcarpet
39
39
  html += "<input #{Util.attributes_to_s(attrs)}"
40
40
  html += ' checked' if checked == 'x'
41
41
  html += ' />'
42
- html += "#{label}</label>" unless label.empty?
42
+ html += "<span>#{label}</span></label>" unless label.empty?
43
43
  end
44
44
 
45
45
  html += '</fieldset>'
@@ -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,11 +6,11 @@ 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
@@ -3,7 +3,7 @@
3
3
  module Redcarpet
4
4
  module Form
5
5
  module Extension
6
- VERSION = '0.1.3'
6
+ VERSION = '0.3.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.3
4
+ version: 0.3.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-13 00:00:00.000000000 Z
11
+ date: 2022-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet
@@ -37,6 +37,7 @@ files:
37
37
  - ".rspec"
38
38
  - ".rubocop.yml"
39
39
  - ".ruby-version"
40
+ - CHANGELOG.md
40
41
  - CODE_OF_CONDUCT.md
41
42
  - Gemfile
42
43
  - Gemfile.lock