Skip to content

Commit 5d6713a

Browse files
committed
2 parents 6132bae + 1cf978a commit 5d6713a

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
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)
44

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)
66

77
## The problem
88

lib/word-to-markdown.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def scrub_whitespace(string)
9292
string.gsub!(/^-[[:space:]·]*/,"- ") # Unnumbered lists
9393
string.gsub!(/\u00A0/, "") # Unicode non-breaking spaces, injected as tabs
9494
string.gsub!(/^ /, "") # Leading spaces
95+
string.gsub!(/^- (\d+)\./, "\\1.") # OL's wrapped in UL's see http://bit.ly/1ivqxy8
9596
string
9697
end
9798

public/assets/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
body {font-size: 2em; padding: 25px 100px 25px 100px; text-align: center; }
2-
footer { position: absolute; bottom: 15px; right: 15px; }
2+
footer { margin: 40px 0 20px; }
33
.moar {text-align: center; margin-top: 100px; }
44
.md-preview, pre { text-align: left; }
55
.rendered-preview { border: 1px solid #ccc; padding: 15px; text-align: left; }

test/fixtures/ul-ol.htm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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>

test/test_word_to_markdown.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class TestWordToMarkdown < Test::Unit::TestCase
3535
validate_fixture "ol", "1. One\n\n2. Two\n\n3. Three"
3636
end
3737

38+
should "not wrap ol in uls" do
39+
validate_fixture "ul-ol", "1. One\n2. Two"
40+
end
41+
3842
should "parse tables" do
3943
validate_fixture "table", "| **Foo** | **Bar** |\n| One | Two |\n| Three | Four |"
4044
end

0 commit comments

Comments
 (0)