We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I'm trying to get syntax highlighting working, but I'm having trouble.
Here is my irb output:
› irb >> require 'html/pipeline' => true >> require 'linguist' => true >> require 'pygments' => false >> pipeline = HTML::Pipeline.new [ ?> HTML::Pipeline::MarkdownFilter, ?> HTML::Pipeline::SyntaxHighlightFilter >> ] => #<HTML::Pipeline:0x007f872b1a7d40 @filters=[HTML::Pipeline::MarkdownFilter, HTML::Pipeline::SyntaxHighlightFilter], @default_context={}, @result_class=Hash, @instrumentation_service=nil> >> result = pipeline.call <<-CODE This is *great*: some_code(:first) CODE => {:output=>#<Nokogiri::HTML::DocumentFragment:0x3fc3958db18c name="#document-fragment" children=[#<Nokogiri::XML::Element:0x3fc3958dae1c name="p" children=[#<Nokogiri::XML::Text:0x3fc3958dff84 "This is ">, #<Nokogiri::XML::Element:0x3fc3958dfe94 name="em" children=[#<Nokogiri::XML::Text:0x3fc3958dfc00 "great">]>, #<Nokogiri::XML::Text:0x3fc3958dfa48 ":">]>, #<Nokogiri::XML::Text:0x3fc3958dada4 "\n\n">, #<Nokogiri::XML::Element:0x3fc3958dad2c name="pre" children=[#<Nokogiri::XML::Element:0x3fc3958df520 name="code" children=[#<Nokogiri::XML::Text:0x3fc3958df28c "some_code(:first)\n">]>]>]>} >> result[:output].to_s => "<p>This is <em>great</em>:</p>\n\n<pre><code>some_code(:first)\n</code></pre>"
The Readme says this should output:
<p>This is <em>great</em>:</p> <div class="highlight"> <pre><span class="n">some_code</span><span class="p">(</span><span class="ss">:first</span><span class="p">)</span> </pre> </div>
This is probably me just not understanding how this works, but I can't figure it out. Any help would be greatly appreciated. Thanks!
Ruby version: 2.0.0 html-pipeline version: 1.9.0 github/linguist version: 2.10.15 pygments.rb version: 0.6.0
The text was updated successfully, but these errors were encountered:
Hello @bradly!
Your setup is working. Just the example in README.md is stale. I am going to update it.
When you use fenced code blocks and specify a language then you will have a <div> with class of highlight and many span elements wrap your code.
<div>
highlight
span
Thanks for reporting! 😊
Sorry, something went wrong.
b722289
No branches or pull requests
Hello,
I'm trying to get syntax highlighting working, but I'm having trouble.
Here is my irb output:
The Readme says this should output:
This is probably me just not understanding how this works, but I can't figure it out. Any help would be greatly appreciated. Thanks!
Ruby version: 2.0.0
html-pipeline version: 1.9.0
github/linguist version: 2.10.15
pygments.rb version: 0.6.0
The text was updated successfully, but these errors were encountered: