Code Monkey home page Code Monkey logo

Comments (5)

patrickdavey avatar patrickdavey commented on June 21, 2024

p.s. my gem is quite rough-and-ready... but I did write a failing spec for the quoting issue... patrickdavey/vimwiki_markdown@3299639

from html-pipeline.

jch avatar jch commented on June 21, 2024

@patrickdavey hmmm, I don't know off the top of my head, but what is the output if you ran it directly through the github-markdown gem? I noticed your diff also bumped the gem to a specific version of github-markdown; Does the problem only appear for specific versions?

from html-pipeline.

patrickdavey avatar patrickdavey commented on June 21, 2024

Hi @jch , I wrote a quick spec file and pushed it up to a repo - spec itself is here:
https://github.com/patrickdavey/githubmarkuptest/blob/master/basic_spec.rb

But to summarise, The only way I could find which correctly gave me a blockquote without a <br> in the middle was:

GitHub::Markup.render('README.markdown', markdown_string)

So.. I guess the pipeline using the HTML::Pipeline::MarkdownFilter is using GitHub::Markdown ultimately which is why I'm seeing the difference.

I guess this means I'd need to use Github::Markup to generate the html from the markdown first, and then pass that into the HTML::Pipeline, which is what they say they're doing over here: https://github.com/github/markup in the README.

Assuming that's correct, please just close this issue. I guess the other thing would be to create a HTML::Pipeline::GithubFlavouredMarkupFilter or similar? If that sounds like something which is useful let me know (and I'll try to make time!)

Thanks for the help, your gem is invaluable! 👍

Best,
Patrick

from html-pipeline.

patrickdavey avatar patrickdavey commented on June 21, 2024

Yip, changing the call to

    github_markup = GitHub::Markup.render('README.markdown', markdown_body)
    pipeline = HTML::Pipeline.new [
      HTML::Pipeline::SyntaxHighlightFilter
    ]   
    result = pipeline.call(github_markup)
    result[:output].to_s

works fine. Assuming that's the way I should always have been using it (quite probably I misunderstood something) please just close this issue.

from html-pipeline.

jch avatar jch commented on June 21, 2024

@patrickdavey nice detective work!

I guess the other thing would be to create a HTML::Pipeline::GithubFlavouredMarkupFilter or similar?

If you're looking for GitHub flavored markdown, you can pass :gfm => true as an option to the filter:

filter = HTML::Pipeline::MarkdownFilter.new("Hi **world**!", :gfm => true)
filter.call

Closing now because you've fixed your issue, but feel free to comment further.

from html-pipeline.

Related Issues (20)

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.