<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="https://sandfox.me/assets/xml/atom.xsl" type="text/xsl media="all"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
  <title>Sand Fox (Posts about commonmarker)</title>
  <id>https://sandfox.me/tags/commonmarker.xml</id>
  <updated>2026-09-02T00:44:42Z</updated>
  <author>
    <name>Anton Smirnov</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://sandfox.me/tags/commonmarker.xml"/>
  <link rel="alternate" type="text/html" href="https://sandfox.me/tags/commonmarker.html"/>
  <generator uri="https://getnikola.com/">Nikola</generator>
  <entry>
    <title>Embracing CommonMark as the One True Markdown</title>
    <id>https://sandfox.me/ruby/embracing-commonmark.html</id>
    <updated>2016-04-06T02:46:00+03:00</updated>
    <published>2016-04-06T02:46:00+03:00</published>
    <author>
      <name>Anton Smirnov</name>
    </author>
    <link rel="alternate" type="text/html" href="https://sandfox.me/ruby/embracing-commonmark.html"/>
    <summary type="html">&lt;div&gt;&lt;p&gt;As you may know, &lt;a class="reference external" href="https://commonmark.org/"&gt;CommonMark&lt;/a&gt; is a project aiming to create unified and
unambiguous Markdown syntax specification. So, I'm in. I want to spread
the word and even use it in my own blog.&lt;/p&gt;
&lt;p&gt;The trouble number one is that Jekyll uses &lt;a class="reference external" href="https://rubygems.org/gems/kramdown"&gt;kramdown&lt;/a&gt; by default.
So we find a gem and the gem is &lt;a class="reference external" href="https://rubygems.org/gems/jekyll-commonmark"&gt;jekyll-commonmark&lt;/a&gt;. Oh hell, we lost
syntax highlighting :(&lt;/p&gt;
&lt;p&gt;The trouble number two is that CommonMark standard lacks support for
server side syntax highlighting. That's bad, I don't want any JavaScript
on my static pages. Let's try to wrap it somehow and enable
syntax highligting.&lt;/p&gt;
&lt;p&gt;The strong side of Ruby CommonMark implementation, &lt;a class="reference external" href="https://rubygems.org/gems/commonmarker"&gt;CommonMarker&lt;/a&gt; is
its ability to parse a document to the abstract syntax tree, so let's use
it to extract our blocks and highlight them with &lt;a class="reference external" href="https://rubygems.org/gems/rouge"&gt;Rouge&lt;/a&gt; for example.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/ruby/embracing-commonmark.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
    <category term="commonmark" label="commonmark"/>
    <category term="commonmarker" label="commonmarker"/>
    <category term="commonmarker-rouge" label="commonmarker-rouge"/>
    <category term="my-projects" label="my projects"/>
    <category term="rouge" label="rouge"/>
    <category term="ruby-gems" label="ruby gems"/>
  </entry>
</feed>
