Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing extensions for markdown when using Redcarpet #345

Closed
jkowens opened this issue Aug 21, 2019 · 4 comments
Closed

Missing extensions for markdown when using Redcarpet #345

jkowens opened this issue Aug 21, 2019 · 4 comments

Comments

@jkowens
Copy link

jkowens commented Aug 21, 2019

This issue stems from an issue reported in the Sinatra repo: sinatra/sinatra/issues/1440.

The code following sums up the issue:

t = Tilt[:markdown] # => Tilt::Redcarpet2Template 
Tilt.default_mapping.extensions_for(t) # => ["markdown"] 

However notice:

Tilt.default_mapping.extensions_for("Tilt::RedcarpetTemplate") # => ["markdown", "mkd", "md"] 

I think the code to try to maintain Redcarpet1 compatibility is creating a problem. Can the Redcarpet1Template be eliminated at this point and we just have a RedcarpetTemplate class?

At a minimum I think the following change needs made, replace:

register_lazy :RedcarpetTemplate, 'tilt/redcarpet', 'markdown', 'mkd', 'md'

with:

register_lazy :Redcarpet1Template,    'tilt/redcarpet',    'markdown', 'mkd', 'md'
register_lazy :Redcarpet2Template,    'tilt/redcarpet',    'markdown', 'mkd', 'md'
@jkowens
Copy link
Author

jkowens commented Aug 21, 2019

Ah didn't realize there was a PR to address this issue (#300). I still think consolidating down to just a single Tilt::RedcarpetTemplate class would be ideal.

@tommay
Copy link
Contributor

tommay commented Aug 21, 2019

It's not clear why that pull request (which is the same as your fix) didn't get merged or rejected three years ago.

@judofyr
Copy link
Collaborator

judofyr commented Oct 26, 2019

This should now be fixed in aea852b. Can you try latest Tilt-master and see it works?

@judofyr judofyr closed this as completed Oct 26, 2019
@jkowens
Copy link
Author

jkowens commented Oct 26, 2019

Thanks @judofyr! That did the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants