lib/redcarpet/form/extension/block/radio_buttons.rb in redcarpet-form-extension-0.2.1 vs lib/redcarpet/form/extension/block/radio_buttons.rb in redcarpet-form-extension-0.3.0
- old
+ new
@@ -6,13 +6,13 @@
module Block
# A fieldset with radion buttons
#
# Ex: (){value="html"} HTML (x){value="css"} CSS (){value="js"} JavaScript
# <fieldset>
- # <label><input type="radio" name="123456" value="html" />HTML</label>
- # <label><input type="radio" name="123456" value="css" checked />CSS</label>
- # <label><input type="radio" name="123456" value="js" />JavaScript</label>
+ # <label><input type="radio" name="123456" value="html" /><span>HTML</span></label>
+ # <label><input type="radio" name="123456" value="css" checked /><span>CSS</span></label>
+ # <label><input type="radio" name="123456" value="js" /><span>JavaScript</span></label>
# </fieldset>
class RadioButtons
def self.pattern
/\((x|\s)?\)([{][^}]*[}])?([^{})()]*)/
end
@@ -37,10 +37,10 @@
html += '<label>' unless label.empty?
html += "<input #{Util.attributes_to_s(attrs)}"
html += ' checked' if checked == 'x'
html += ' />'
- html += "#{label}</label>" unless label.empty?
+ html += "<span>#{label}</span></label>" unless label.empty?
end
html += '</fieldset>'
end
# rubocop:enable Metrics/AbcSize