File: escape.rb

package info (click to toggle)
ruby-bluefeather 0.41-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 676 kB
  • ctags: 169
  • sloc: ruby: 4,195; makefile: 8
file content (25 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'pathname'
require(Pathname.new(__FILE__).parent + 'lib/common.rb')


describe 'Escape Characters:' do
	before(:each) do
		@bf = BlueFeather::Parser.new
	end
	
	'\\`*_{}[]()#.!|:~'.each_char do |c|
		specify "'#{c}'" do
			@bf.parse_text("\\#{c}").should == "<p>#{c}</p>"
		end
		
		specify "'#{c}' (in code block)" do
			@bf.parse_text("    \\#{c}").should == "<pre><code>\\#{c}\n</code></pre>"
		end
	end
end

describe 'Backquote Escape:' do
	specify do
		BlueFeather.parse_text('`<http://example.net/>`').should == "<p><code>&lt;http://example.net/&gt;</code></p>"
	end
end