lib/govspeak.rb in govspeak-5.2.1 vs lib/govspeak.rb in govspeak-5.2.2

- old
+ new

@@ -134,21 +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 + (?:\r|\n|^) # non-capturing match to make sure start of line and linebreak {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 + (?:\r|\n|$) # non-capturing match to make sure end of line and linebreak }x) { |attributes, text, href| button_classes = "button" button_classes << " button-start" if attributes =~ /start/ /cross-domain-tracking:(?<cross_domain_tracking>.[^\s*]+)/ =~ attributes data_attribute = ""