GithubHelp home page GithubHelp logo

rdblue / marker Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 6.0 187 KB

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

Ruby 100.00%

marker's People

Contributors

adamlamar avatar rdblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

marker's Issues

Marker crashes on 1.9.2

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:inpresent?'
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:into_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:into_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:inmap'
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

'

Case-insensitive template names

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.