Skip to content

Commit

Permalink
support code with Text::Markdown::Hoedown (close #24, close #68)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Mar 3, 2014
1 parent 2efba3a commit c46205d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requires 'Text::Markdown';
requires 'Text::Markdown::Hoedown';
requires 'HTML::TreeBuilder';
requires 'Unicode::EastAsianWidth';
requires 'Pod::Usage';
Expand Down
6 changes: 2 additions & 4 deletions lib/Text/Md2Inao.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use Carp;
use Class::Accessor::Fast qw/antlers/;
use Encode;
use HTML::TreeBuilder;
use Text::Markdown 'markdown';
use Text::Markdown::Hoedown;

use Text::Md2Inao::Director;
use Text::Md2Inao::Builder::Inao;
Expand Down Expand Up @@ -82,9 +82,7 @@ sub to_html_tree {
my $text = shift;

$text = prepare_text_for_markdown($text);

## Work Around: Text::Markdown が flagged string だと一部 buggy なので encode してから渡している
my $html = decode_utf8 markdown(encode_utf8 $text);
my $html = markdown($text);
$html = prepare_html_for_inao($html);

my $tree = HTML::TreeBuilder->new;
Expand Down
13 changes: 13 additions & 0 deletions t/05_basic_synatx.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ __END__
--- expected
通常の本文◆cmd/◆インラインのコード◆/cmd◆通常の本文

===
--- in md2inao
通常の本文

```
インラインのコード
```

通常の本文
--- expected
通常の本文
◆cmd/◆インラインのコード◆/cmd◆
通常の本文
===
--- in md2inao
通常の本文(注:注釈ですよ。_イタリック_)通常の本文
Expand Down
2 changes: 0 additions & 2 deletions t/11_html_tag.t
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ RubyMotion◆注/◆http://www.rubymotion.org/◆/注◆
=== div but unknown class
--- in md2inao
test
<div class="unknown">foobar</div>
--- expected chomp
test
<div class="unknown">foobar</div>

0 comments on commit c46205d

Please sign in to comment.