• Development

    Quick Tip: Using Markdown Filter with SyntaxHighlighter

    I was having issues where my syntax highlighting would contain <p> tags and <br> tags that weren’t really there. The reason seemed to be that Markdown was interpreting the code within the Syntax Highlighter code blocks, which is not what I wanted.

    To solve…

    In your Markdown text format, make sure the order has Syntax Highlighter above Markdown. In your Syntax Highlighter configuration set div as the Tag name setting. Markdown will ignore div tags and Syntax Highlighter will highlight them.

    Note that those are the only two filters I use in my Markdown text format. You may need to do more tweaking if you use more filters.

    Lastly, I actually prefer highlight.js, so I’ll probably be ditching Syntax Highlighter altogether… my blog is currently using both solutions. Excuse any messes if you see them; it’s in transition.

  • Development

    Free Shipping for Specific Products in Drupal Commerce

    Recently I had a client call me asking if she could offer free shipping on a specific promotional/limited-run product. Unfortunately I didn’t find any clear-cut solutions in contrib or Drupal Commerce core. Also, I could not come up with a way to do this in core through the Drupal admin UI. It’s very easy to allow a “Free” shipping method if a specific product is found in the cart/order, but we only wanted the “free” deal to apply to the single product (any quantity of it).