Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Check out repository code
uses: actions/checkout@master
- name: Install dependencies
run: shards install --without-development
run: shards install
- name: Cache Ameba binary
id: cache-ameba
uses: actions/cache@v3
Expand Down
4 changes: 4 additions & 0 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: markd
version: 0.6.0

development_dependencies:
tartrazine :
github: ralsina/tartrazine

authors:
- icyleaf <icyleaf.cn@gmail.com>
- nobodywasishere <margret@eowyn.net>
Expand Down
10 changes: 10 additions & 0 deletions spec/fixtures/tartrazine.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require "tartrazine"

Check failure on line 1 in spec/fixtures/tartrazine.cr

View workflow job for this annotation

GitHub Actions / Crystal latest specs on ubuntu-latest

can't find file 'tartrazine'

Check failure on line 1 in spec/fixtures/tartrazine.cr

View workflow job for this annotation

GitHub Actions / Crystal specs on windows-latest

can't find file 'tartrazine'

Check failure on line 1 in spec/fixtures/tartrazine.cr

View workflow job for this annotation

GitHub Actions / Crystal specs on macos-latest

can't find file 'tartrazine'

Check failure on line 1 in spec/fixtures/tartrazine.cr

View workflow job for this annotation

GitHub Actions / Crystal nightly specs on ubuntu-latest

can't find file 'tartrazine'
require "../../src/markd"

markdown = <<-MD
# Hello Markd

> Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification.
MD

html = Markd.to_html(markdown)
4 changes: 4 additions & 0 deletions spec/markd_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@

Markd.to_html(raw).should eq(html)
end

it "should no error when require tartrazine" do
{{ run("./fixtures/tartrazine.cr") }}

Check failure on line 33 in spec/markd_spec.cr

View workflow job for this annotation

GitHub Actions / Crystal latest specs on ubuntu-latest

expanding macro

Check failure on line 33 in spec/markd_spec.cr

View workflow job for this annotation

GitHub Actions / Crystal specs on windows-latest

expanding macro

Check failure on line 33 in spec/markd_spec.cr

View workflow job for this annotation

GitHub Actions / Crystal specs on macos-latest

expanding macro

Check failure on line 33 in spec/markd_spec.cr

View workflow job for this annotation

GitHub Actions / Crystal nightly specs on ubuntu-latest

expanding macro
end
end
8 changes: 6 additions & 2 deletions src/markd/renderers/html_renderer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ module Markd
end

def code_block(node : Node, entering : Bool, formatter : T? = nil) : Nil forall T
{% if @top_level.has_constant?("Tartrazine") && !formatter.nil? %}
render_code_block_use_tartrazine(node, formatter)
{% if @top_level.has_constant?("Tartrazine") %}
if formatter
render_code_block_use_tartrazine(node, formatter)
else
render_code_block_use_code_tag(node)
end
{% else %}
render_code_block_use_code_tag(node)
{% end %}
Expand Down
Loading