Created
July 16, 2012 08:48
-
-
Save Arcath/3121601 to your computer and use it in GitHub Desktop.
Markabb 1.0.0 Release post Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upcaser = Markabb::Callback.new(Proc.new { |s| | |
s.upcase | |
}) | |
Markabb.register_tag :upcase, Markabb::Tag.new('up', upcaser) | |
"[up]FooBAr[/up]".markabb # > FOOBAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Markabb.configure do |c| | |
c.disable_formatting = true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Markabb.configure do |c| | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Markabb.register_tag :bold_and_italic, Markabb::Tag.new('bi','<b><i>\1</i></b>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Directly on a string | |
"[b]Bold[/b]".markabb # > <b>Bold</b> | |
# By calling Parse | |
Markabb.parse "[b]Bold[/b]" # > <b>Bold</b> | |
# By calling Parse with a block | |
Markabb.parse "[b]Bold[/b]" do |c| | |
c.disable_formatting = true | |
end # > [b]Bold[/b] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment