redcarpet-form-extension 0.1.3 → 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '04784500442b55459e454027f39baf7db8ebf23078bf21ff27f0435330a0df23'
|
4
|
+
data.tar.gz: 4aab43096cb5d4c9783036bcd02497223858964d46339523784ab8760972d80e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0487ef8559826e785571798d309a02446c5388d3ff178621919c92a995017f201006485f4e29dae4c1e47293cfb8ae90f88cfcc2d15edf637167f78a481966
|
7
|
+
data.tar.gz: 901dfd62ea1bc57a60d9505ecd8516962788f5444e871990c157d4ddf0a512218eedc55cf81fa20d29f2e3ab65f1d2fdea652f8db56525d3e728804eb71e081a
|
data/Gemfile.lock
CHANGED
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
|
33
|
+
Some text before [input]{ type="number" } and after.
|
34
34
|
```
|
35
35
|
|
36
36
|
Returns:
|
@@ -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,11 +6,11 @@ module Redcarpet
|
|
6
6
|
module Inline
|
7
7
|
# A single input tag
|
8
8
|
#
|
9
|
-
# Ex:
|
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
|
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.
|
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-
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|