rdblue / marker Goto Github PK
View Code? Open in Web Editor NEWA markup parser that outputs html and text. Syntax is similar to MediaWiki.
Home Page: http://github.com/rdblue/marker
License: GNU General Public License v3.0
A markup parser that outputs html and text. Syntax is similar to MediaWiki.
Home Page: http://github.com/rdblue/marker
License: GNU General Public License v3.0
Hey i just thought i'd throw you a data point. I'm writing some wiki software that can use multiple markup languages. I found yer gem and was testing against it, until i discovered that even basic use crashes in Ruby 1.9.2
Lemme know if you get this fixed, i'll toss it back in my wiki :)
caelesta:wimple knowtheory$ irb
ruby-1.9.2-preview1 > require 'marker'
=> true
ruby-1.9.2-preview1 > Marker.parse("= This is a Mediawiki heading =").to_html
NoMethodError: undefined method any?' for " ":String from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/common.rb:14:in
present?'
from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/text.rb:44:in space?' from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/text.rb:30:in
to_html'
from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/headings.rb:68:in label' from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/headings.rb:22:in
to_html'
from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/markup.rb:15:in block in to_html' from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/markup.rb:15:in
map'
from /Users/knowtheory/.rvm/gems/ruby-1.9.2-preview1/gems/marker-0.2.2/lib/marker/markup.rb:15:in to_html' from (irb):2 from /Users/knowtheory/.rvm/rubies/ruby-1.9.2-preview1/bin/irb:17:in
Hi there,
Firstly - great project. I'm potentially going to be making heavy use of this and would love to contribute back if you are interested in having someone working with you on this?
First little thing I've run into is that template names are currently case sensitive, which is a problem as people cannot be guaranteed to use the correct case in their markup and it is nicer to keep the method names in lowercase in ruby so they are not misinterpreted as constants. I propose changing Marker::Template.render to send a downcase version of the template name to the Marker templates, so the following change.
def render( format, options = {} )
Marker.templates.send( target, format, *arg_list( format, options ) )
end
to
def render( format, options = {} )
Marker.templates.send( target.downcase, format, *arg_list( format, options ) )
end
Thanks,
iHiD (Jeremy Walker)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.