File tree Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
A Ruby gem to liberate content from [ the jail that is Word documents] ( http://ben.balter.com/2012/10/19/we-ve-been-trained-to-make-paper/#jailbreaking-content )
4
4
5
- [ ![ Build Status] ( https://travis-ci.org/benbalter/word-to-markdown.svg?branch=master )] ( https://travis-ci.org/benbalter/word-to-markdown ) [ ![ Gem Version] ( https://badge.fury.io/rb/word-to-markdown.png )] ( http://badge.fury.io/rb/word-to-markdown )
5
+ [ ![ Build Status] ( https://travis-ci.org/benbalter/word-to-markdown.svg?branch=master )] ( https://travis-ci.org/benbalter/word-to-markdown ) [ ![ Gem Version] ( https://badge.fury.io/rb/word-to-markdown.png )] ( http://badge.fury.io/rb/word-to-markdown ) [ ![ Inline docs ] ( http://inch-pages.github.io/github/benbalter/word-to-markdown.png )] ( http://inch-pages.github.io/github/benbalter/word-to-markdown )
6
6
7
7
## The problem
8
8
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ def scrub_whitespace(string)
92
92
string . gsub! ( /^-[[:space:]·]*/ , "- " ) # Unnumbered lists
93
93
string . gsub! ( /\u00A0 / , "" ) # Unicode non-breaking spaces, injected as tabs
94
94
string . gsub! ( /^ / , "" ) # Leading spaces
95
+ string . gsub! ( /^- (\d +)\. / , "\\ 1." ) # OL's wrapped in UL's see http://bit.ly/1ivqxy8
95
96
string
96
97
end
97
98
Original file line number Diff line number Diff line change 1
1
body {font-size : 2em ; padding : 25px 100px 25px 100px ; text-align : center; }
2
- footer { position : absolute; bottom : 15 px ; right : 15 px ; }
2
+ footer { margin : 40 px 0 20 px ; }
3
3
.moar {text-align : center; margin-top : 100px ; }
4
4
.md-preview , pre { text-align : left; }
5
5
.rendered-preview { border : 1px solid # ccc ; padding : 15px ; text-align : left; }
Original file line number Diff line number Diff line change
1
+ < p class =MsoListParagraphCxSpMiddle style ='text-indent:-.25in;mso-list:l0 level1 lfo1 '> <![if !supportLists]> < span
2
+ style ='mso-fareast-font-family:Cambria;mso-fareast-theme-font:minor-latin;
3
+ mso-bidi-font-family:Cambria;mso-bidi-theme-font:minor-latin '> < span
4
+ style ='mso-list:Ignore '> 1.< span style ='font:7.0pt "Times New Roman" '> </ span > </ span > </ span > <![endif]> One</ p >
5
+
6
+ < p class =MsoListParagraphCxSpMiddle style ='text-indent:-.25in;mso-list:l0 level1 lfo1 '> <![if !supportLists]> < span
7
+ style ='mso-fareast-font-family:Cambria;mso-fareast-theme-font:minor-latin;
8
+ mso-bidi-font-family:Cambria;mso-bidi-theme-font:minor-latin '> < span
9
+ style ='mso-list:Ignore '> 2.< span style ='font:7.0pt "Times New Roman" '> </ span > </ span > </ span > <![endif]> Two</ p >
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ class TestWordToMarkdown < Test::Unit::TestCase
35
35
validate_fixture "ol" , "1. One\n \n 2. Two\n \n 3. Three"
36
36
end
37
37
38
+ should "not wrap ol in uls" do
39
+ validate_fixture "ul-ol" , "1. One\n 2. Two"
40
+ end
41
+
38
42
should "parse tables" do
39
43
validate_fixture "table" , "| **Foo** | **Bar** |\n | One | Two |\n | Three | Four |"
40
44
end
You can’t perform that action at this time.
0 commit comments