Class: BlueCloth

Inherits:
Object
  • Object
show all
Defined in:
lib/bluecloth.rb

Overview

BlueCloth is a Ruby implementation of Markdown, a text-to-HTML conversion tool.

Defined Under Namespace

Modules: Transform

Constant Summary

Version =
[:major, :minor, :patch].map { |bit| version_hash[bit] }.join('.')

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (BlueCloth) initialize(content = "",, *restrictions)

Create a new BlueCloth string.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/bluecloth.rb', line 62

def initialize(content = "", *restrictions)
	@log = Logger::new( $deferr )
	@log.level = $DEBUG ?
		Logger::DEBUG :
		($VERBOSE ? Logger::INFO : Logger::WARN)
	@scanner = nil

	# Add any restrictions, and set the line-folding attribute to reflect
	# what happens by default.
	@filter_html = nil
	@filter_styles = nil
	restrictions.flatten.each {|r| __send__("#{r}=", true) }
	@fold_lines = true

   @content = content

	@log.debug "String is: %p" % self
end

Instance Attribute Details

- (Object) filter_html

Filters for controlling what gets output for untrusted input. (But really, you're filtering bad stuff out of untrusted input at submission-time via untainting, aren't you?)



84
85
86
# File 'lib/bluecloth.rb', line 84

def filter_html
  @filter_html
end

- (Object) filter_styles

Filters for controlling what gets output for untrusted input. (But really, you're filtering bad stuff out of untrusted input at submission-time via untainting, aren't you?)



84
85
86
# File 'lib/bluecloth.rb', line 84

def filter_styles
  @filter_styles
end

- (Object) fold_lines

RedCloth-compatibility accessor. Line-folding is part of Markdown syntax, so this isn't used by anything.



88
89
90
# File 'lib/bluecloth.rb', line 88

def fold_lines
  @fold_lines
end