vendor/gems/BlueCloth-1.0.0/lib/bluecloth.rb
### Apply Markdown header transforms to a copy of the given +str+ amd render
### state +rs+ and return the result.
Apply Markdown header transforms to a copy of the given +str+ amd render
state +rs+ and return the result.
Apply Markdown header transforms to a copy of the given + str + amd render state + rs + and return the result .
def transform_headers( str, rs )
		@log.debug " Transforming headers"
		str.
			gsub( SetextHeaderRegexp ) {|m|
				@log.debug "Found setext-style header"
				title, hdrchar = $1, $2
				title = apply_span_transforms( title, rs )
				case hdrchar
				when '='
					%[<h1>{title}</h1>\n\n]
				when '-'
					%[<h2>{title}</h2>\n\n]
				else
					title
				end
			}.
			gsub( AtxHeaderRegexp ) {|m|
				@log.debug "Found ATX-style header"
				hdrchars, title = $1, $2
				title = apply_span_transforms( title, rs )
				level = hdrchars.length
				%{<h%d>%s</h%d>\n\n} % [ level, title, level ]
			}
	end
def transform_headers ( str , rs ) @log . debug " Transforming headers" str . gsub ( SetextHeaderRegexp ) { | m | @log . debug "Found setext-style header" title , hdrchar = $1 , $2 title = apply_span_transforms ( title , rs ) case hdrchar when '=' %[<h1>#{title}</h1>\n\n] when '-' %[<h2>#{title}</h2>\n\n] else title end } . gsub ( AtxHeaderRegexp ) { | m | @log . debug "Found ATX-style header" hdrchars , title = $1 , $2 title = apply_span_transforms ( title , rs ) level = hdrchars . length %{<h%d>%s</h%d>\n\n} % [ level , title , level ] } end
Apply Markdown header transforms to a copy of the given +str+ amd render
state +rs+ and return the result.
Apply Markdown header transforms to a copy of the given + str + amd render state + rs + and return the result .
# Setext-style headers: #	  Header 1 #	  ======== #   #	  Header 2 #	  -------- #
str
<not_specific>
rs
<not_specific>