[DRE-commits] [ruby-org] 273/303: Cosmetic change in regexps.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:34:11 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit b6ad76e6b0720a3e4776300c6ac0ca2b4a4023cc
Author: vonavi <ivvl82 at gmail.com>
Date:   Sun Feb 3 21:59:42 2013 +0200

    Cosmetic change in regexps.
---
 lib/org-ruby/html_output_buffer.rb |    4 ++--
 lib/org-ruby/regexp_helper.rb      |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/org-ruby/html_output_buffer.rb b/lib/org-ruby/html_output_buffer.rb
index 568cc90..f8321aa 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -328,8 +328,8 @@ module Orgmode
     end
 
     def strip_code_block!
-      strip_regexp = Regexp.new('\n' + ' ' * @code_block_indent)
-      @buffer.gsub!(strip_regexp, "\n")
+      strip_regexp = Regexp.new("^" + " " * @code_block_indent)
+      @buffer.gsub!(strip_regexp, "")
       @code_block_indent = nil
     end
   end                           # class HtmlOutputBuffer
diff --git a/lib/org-ruby/regexp_helper.rb b/lib/org-ruby/regexp_helper.rb
index a823f59..5645533 100644
--- a/lib/org-ruby/regexp_helper.rb
+++ b/lib/org-ruby/regexp_helper.rb
@@ -50,14 +50,14 @@ module Orgmode
 
     def initialize
       # Set up the emphasis regular expression.
-      @pre_emphasis = " \t\\('\"\\{"
-      @post_emphasis = "- \t\\.,:!\\?;'\"\\)\\}\\\\"
-      @border_forbidden = " \t\r\n,\"'"
-      @body_regexp = ".*?"
+      @pre_emphasis = ' \t\(\'"\{'
+      @post_emphasis = '- \t\.,:!\?;\'"\)\}\\\\'
+      @border_forbidden = '\s,"\''
+      @body_regexp = '.*?'
       @max_newlines = 1
       @body_regexp = "#{@body_regexp}" +
-                     "(?:\n#{@body_regexp}){0,#{@max_newlines}}" if @max_newlines > 0
-      @markers = "\\*\\/_=~\\+"
+                     "(?:\\n#{@body_regexp}){0,#{@max_newlines}}" if @max_newlines > 0
+      @markers = '\*\/_=~\+'
       @code_snippet_stack = []
       @logger = Logger.new(STDERR)
       @logger.level = Logger::WARN

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list