lib/govspeak.rb in govspeak-5.2.0 vs lib/govspeak.rb in govspeak-5.2.1
- old
+ new
@@ -134,19 +134,21 @@
def insert_strong_inside_p(body, parser=Govspeak::Document)
parser.new(body.strip).to_html.sub(/^<p>(.*)<\/p>$/,"<p><strong>\\1</strong></p>")
end
extension('button', %r{
+ ^ # Match start of line only, allows for indenting code examples
{button(.*?)} # match opening bracket and capture attributes
\s* # any whitespace between opening bracket and link
\[ # match start of link markdown
([^\]]+) # capture inside of link markdown
\] # match end of link markdown
\( # match start of link text markdown
([^)]+) # capture inside of link text markdown
\) # match end of link text markdown
\s* # any whitespace between opening bracket and link
{\/button} # match ending bracket
+ $ # Match end of line only, allows for indenting code examples
}x) { |attributes, text, href|
button_classes = "button"
button_classes << " button-start" if attributes =~ /start/
/cross-domain-tracking:(?<cross_domain_tracking>.[^\s*]+)/ =~ attributes
data_attribute = ""