Created
February 18, 2010 15:10
-
-
Save zunda/307724 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v test.rb | |
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux] | |
["image", "# src = map.gif\n# relative_height = 100\n"] | |
["image\r", "# src = map.gif\r\n# relative_height = 100\r\n"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v test.rb | |
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] | |
["image", "# src = map.gif\n# relative_height = 100\n"] | |
["image\r", "# src = map.gif\r\n# relative_height = 100\r\n"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rd2rabbit-lib.rb:131 | |
def match(element) | |
content = [] | |
element.each_line do |line| | |
content << line | |
end | |
content_str = content.join("") | |
/\A#\s*([^\n]+)(?:\n)?(?m:(.*)?)\z/ =~ content_str | |
return $1, $2.to_s | |
end | |
[ | |
"#image\n# src = map.gif\n# relative_height = 100\n", | |
"#image\r\n# src = map.gif\r\n# relative_height = 100\r\n" | |
].each do |element| | |
p match(element) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: lib/rabbit/parser/rd/rd2rabbit-lib.rb | |
=================================================================== | |
--- lib/rabbit/parser/rd/rd2rabbit-lib.rb (リビジョン 1371) | |
+++ lib/rabbit/parser/rd/rd2rabbit-lib.rb (作業コピー) | |
@@ -127,9 +127,9 @@ | |
def apply_to_Verbatim(element) | |
content = [] | |
element.each_line do |line| | |
- content << line | |
+ content << line.chomp | |
end | |
- content_str = content.join("") | |
+ content_str = content.join("\n") | |
/\A#\s*([^\n]+)(?:\n)?(?m:(.*)?)\z/ =~ content_str | |
apply_to_extension("block_verbatim", $1, $2.to_s, content_str) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment