Bring up to current.
This commit is contained in:
parent
69b62b6f33
commit
b19e1e4f47
71 changed files with 8305 additions and 39 deletions
33
lib/maruku/usage/example1.rb
Normal file
33
lib/maruku/usage/example1.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
require 'maruku'
|
||||
|
||||
text = <<EOF
|
||||
Chapter 1
|
||||
=========
|
||||
|
||||
It was a stormy and rainy night.
|
||||
|
||||
EOF
|
||||
|
||||
invalid = <<EOF
|
||||
|
||||
This is a [bad link.
|
||||
|
||||
EOF
|
||||
|
||||
Maruku.new(text).to_html
|
||||
|
||||
s = ""
|
||||
|
||||
begin
|
||||
Maruku.new(invalid, {:on_error => :raise, :error_stream => s})
|
||||
puts "Error! It should have thrown an exception."
|
||||
rescue
|
||||
# puts "ok, got error"
|
||||
end
|
||||
|
||||
begin
|
||||
Maruku.new(invalid, {:on_error => :warning, :error_stream => s})
|
||||
rescue
|
||||
puts "Error! It should not have thrown an exception."
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue