Permalink
Browse files

use greedy regex

  • Loading branch information...
1 parent 525135a commit 43c7f02dae03d082e13cc1de3446244feddbf03d @sandrods committed Mar 15, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/odf-report/parser/default.rb
@@ -59,9 +59,9 @@ def add_paragraph(text, style)
def parse_formatting(text)
text.strip!
- text.gsub!(/<strong>(.+)<\/strong>/) { "<text:span text:style-name=\"bold\">#{$1}<\/text:span>" }
- text.gsub!(/<em>(.+)<\/em>/) { "<text:span text:style-name=\"italic\">#{$1}<\/text:span>" }
- text.gsub!(/<u>(.+)<\/u>/) { "<text:span text:style-name=\"underline\">#{$1}<\/text:span>" }
+ text.gsub!(/<strong>(.+?)<\/strong>/) { "<text:span text:style-name=\"bold\">#{$1}<\/text:span>" }
+ text.gsub!(/<em>(.+?)<\/em>/) { "<text:span text:style-name=\"italic\">#{$1}<\/text:span>" }
+ text.gsub!(/<u>(.+?)<\/u>/) { "<text:span text:style-name=\"underline\">#{$1}<\/text:span>" }
text.gsub!("\n", "")
text
end

0 comments on commit 43c7f02

Please sign in to comment.