Class: Redcarpet::Socialable
- Inherits:
-
Render::HTML
- Object
- Render::HTML
- Redcarpet::Socialable
show all
- Includes:
- Hashtags, Mentions
- Defined in:
- lib/redcarpet/socialable.rb
Defined Under Namespace
Modules: Hashtags, Mentions
Constant Summary
collapse
- BASE_REGEXP =
'(<\/?[^>]*>)?' +
'(^|[\s\>])+' +
'%s' +
'(\b|\-|\.|,|:|;|\?|!|\(|\)|$)?' +
'(<\/?[^>]*>)?'
Instance Method Summary
collapse
Methods included from Hashtags
#postprocess
Methods included from Mentions
#postprocess
Instance Method Details
31
32
33
|
# File 'lib/redcarpet/socialable.rb', line 31
def (text, level)
"<h#{level}>#{safe_replace(text)}</h#{level}>"
end
|
#list_item(text, list_type) ⇒ Object
27
28
29
|
# File 'lib/redcarpet/socialable.rb', line 27
def list_item(text, list_type)
"<li>#{safe_replace(text)}</li>"
end
|
#paragraph(text) ⇒ Object
23
24
25
|
# File 'lib/redcarpet/socialable.rb', line 23
def paragraph(text)
"<p>#{safe_replace(text)}</p>"
end
|
#safe_replace(text) ⇒ Object
35
36
37
38
|
# File 'lib/redcarpet/socialable.rb', line 35
def safe_replace(text)
text = process_mentions(text)
process_hashtags(text)
end
|