0
@@ -17,19 +17,19 @@ class ClothBlue < String
0
["<b>", "**"], ["</b>","**"], ["<em>","_"], ["</em>", "_"], ["<b>", "**"],
0
- ["</b>", "**"], ["<code>", "`"], ["<i>","_"], ["</i>", "_"]
0
+ ["</b>", "**"], ["<code>", "`"], ["<i>","_"], ["</i>", "_"]
,0
["</code>", "`"], ["<strong>", "**"], ["</strong>", "**"]
0
- ["<h1>","# "], ["</h1>", "#"], ["<h2>","## "], ["</h2>", "##"],
0
- ["<h3>","### "], ["</h3>", "###"], ["<h4>","#### "], ["</h4>", "####"],
0
- ["<h5>","##### "], ["</h5>", "#####"], ["<h6>","###### "], ["</h6>", "######"]
0
+ ["<h1>","# "], ["</h1>", " #\n\n"], ["<h2>","## "], ["</h2>", " ##\n\n"],
0
+ ["<h3>","### "], ["</h3>", " ###\n\n"], ["<h4>","#### "], ["</h4>", " ####\n\n"],
0
+ ["<h5>","##### "], ["</h5>", " #####\n\n"], ["<h6>","###### "], ["</h6>", " ######\n\n"]
0
- ["<p>", ""],["</p>","\n\n"], ["<blockquote>", "> "], ["</blockquote>","\n"],
0
- ["<br />", "\n\n"], ["<br>", "\n\n"]
0
+ ["<p>", "\n\n"],["</p>","\n\n"], ["<blockquote>", "> "], ["</blockquote>","\n"],
0
+ ["<br />", "\n"], ["<br>", "\n"]
0
@@ -37,6 +37,10 @@ class ClothBlue < String
0
["–","-"], ["…", "..."], ["×", " x "], ["™","(TM)"],
0
["®","(R)"], ["©","(C)"], ["’", "'"]
0
+ ["<ol>", ""], ["</ol>", "\n\n"], ["<ul>", ""], ["</ul>", "\n\n"], ["<li>", "+ "], ["</li>", "\n"]
0
["<table>","\n\n<table>"], ["</table>","</table>\n\n"]
0
@@ -48,12 +52,13 @@ class ClothBlue < String
0
- #Call all necessary methods to convert a string of HTML into
Textile markup.
0
+ #Call all necessary methods to convert a string of HTML into
Markdown markup.
0
structure(@workingcopy)
0
text_formatting(@workingcopy)
0
@workingcopy = CGI::unescapeHTML(@workingcopy)
0
@@ -65,39 +70,47 @@ class ClothBlue < String
0
def text_formatting(text)
0
- TEXT_FORMATTING.each do |htmltag, textiletag|
0
- text.gsub!(htmltag, textiletag)
0
+ TEXT_FORMATTING.each do |htmltag, markdowntag|
0
+ text.gsub!(htmltag, markdowntag)
0
- HEADINGS.each do |htmltag, textiletag|
0
- text.gsub!(htmltag, textiletag)
0
+ HEADINGS.each do |htmltag, markdowntag|
0
+ text.gsub!(htmltag, markdowntag)
0
+ LISTS.each do |htmltag, markdowntag|
0
+ text.gsub!(htmltag, markdowntag)
0
- ENTITIES.each do |htmlentity, textileentity|
0
- text.gsub!(htmlentity, textileentity)
0
+ ENTITIES.each do |htmlentity, markdownentity|
0
+ text.gsub!(htmlentity, markdownentity)
0
- STRUCTURES.each do |htmltag, textiletag|
0
- text.gsub!(htmltag, textiletag)
0
+ STRUCTURES.each do |htmltag, markdowntag|
0
+ text.gsub!(htmltag, markdowntag)
0
- TABLES.each do |htmltag, textiletag|
0
- text.gsub!(htmltag, textiletag)
0
+ TABLES.each do |htmltag, markdowntag|
0
+ text.gsub!(htmltag, markdowntag)
Comments
No one has commented yet.