Skip to content

Commit

Permalink
add test code
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Dec 21, 2023
1 parent ee93ac3 commit a778873
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('Hexo Renderer Markdown-it', () => {
const resultInline = renderer.render({ text }, { inline: true });
resultBlock.should.eql('<p>inline text</p>\n');
resultInline.should.eql('inline text');
})
});
});

describe('plugins', () => {
Expand Down Expand Up @@ -403,6 +403,15 @@ describe('Hexo Renderer Markdown-it', () => {
result.should.eql('<p><img src="/blog/bar/baz.jpg" alt=""></p>\n');
});

it('alt text', () => {
hexo.config.markdown.images = { test: true };

const renderer = new Renderer(hexo);
const result = renderer.render({ text: '![alt text](/bar/baz.jpg)' });

result.should.eql('<p><img src="/bar/baz.jpg" alt="alt text"></p>\n');
});

describe('post_asset', () => {
const Post = hexo.model('Post');
const PostAsset = hexo.model('PostAsset');
Expand Down

0 comments on commit a778873

Please sign in to comment.