Skip to content

Commit b4f964c

Browse files
committed
Update prompt_regexp for console code examples in guides
For code examples in irb we remove the prompt (`irb>`) from the results for the copy button. For the following example the result would be `puts "hello!"`: ```irb irb> puts "hello!" ``` With the updated console prompt the regexp needs to change to support: ```irb blog(test)> puts "hello!" ```
1 parent 31c060c commit b4f964c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guides/rails_guides/markdown/renderer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def clipboard_content(code, language)
8888
when "bash"
8989
/^\$ /
9090
when "irb"
91-
/^irb.*?> /
91+
/^(irb.*?|\w+\(\w+\))> /
9292
end
9393

9494
if prompt_regexp

0 commit comments

Comments
 (0)