bhollis / maruku

A pure-Ruby Markdown-superset interpreter (Official Repo).
MIT License
500 stars 80 forks source link

Add test for ellipsis at the end of a line #131

Closed stomar closed 10 years ago

stomar commented 10 years ago

This adds a test case for issue #130.

(As of now it fails.)

bhollis commented 10 years ago

Thanks @stomar. If you don't mind I'll keep this open until I have a fix that makes that test pass.

distler commented 10 years ago
--- a/lib/maruku/input/rubypants.rb 2013-12-15 20:13:49.000000000 -0600
+++ b/lib/maruku/input/rubypants.rb 2014-05-07 16:19:35.000000000 -0500
@@ -172,7 +172,7 @@
           end
         end
       else
-        intersperse(first.split(pattern), replacement).each do |x|
+        intersperse(first.split(pattern,-1), replacement).each do |x|
           append_to_output(output, x)
         end
       end
bhollis commented 10 years ago

Thanks for the patch, @distler! Test and patch have been pushed.

stomar commented 10 years ago

Thanks!

Will there be a bugfix release sometime soon? (GitHub pages at the moment still uses Maruku by default.)

distler commented 10 years ago

Just a postscript :

In investigating this, I noticed that Maruku spends 1/4-1/3 (!) of its time in Rubypants. That seems like a long amount of time for the sake of some curly quotes. Any optimizations that would speed up Rubypants would yield large dividends.

bhollis commented 10 years ago

Yeah, it's a ton of global regexes, no wonder.

-Ben

Sent from my phone

On May 7, 2014, at 11:52 PM, Jacques Distler notifications@github.com wrote:

Just a postscript :

In investigating this, I noticed that Maruku spends 1/4-1/3 (!) of its time in Rubypants. That seems like a long amount of time for the sake of some curly quotes. Any optimizations that would speed up Rubypants would yield large dividends.

— Reply to this email directly or view it on GitHubhttps://github.com/bhollis/maruku/pull/131#issuecomment-42518512 .

bhollis commented 10 years ago

There will be, eventually.

-Ben

Sent from my phone

On May 7, 2014, at 11:48 PM, Marcus Stollsteimer notifications@github.com wrote:

Thanks!

Will there be a bug fix release? (GitHub pages at the moment still uses Maruku by default.)

— Reply to this email directly or view it on GitHubhttps://github.com/bhollis/maruku/pull/131#issuecomment-42518339 .

distler commented 10 years ago

Yeah, it's a ton of global regexes, no wonder.

Indeed.

I guess I never looked at it before. Far better to dispense with it entirely, and build the requisite education into the span-parser.

The speedup is even greater than I thought ( ~40% !).

bhollis commented 10 years ago

Maruku 0.7.2 has been released. Thanks everyone! https://github.com/bhollis/maruku/blob/master/CHANGELOG.md