开源软件名称(OpenSource Name):tatsy/markdown-it-imsize开源软件地址(OpenSource Url):https://github.com/tatsy/markdown-it-imsize开源编程语言(OpenSource Language):JavaScript 99.5%开源软件介绍(OpenSource Introduction):markdown-it-imsize
UsageEnable pluginvar md = require('markdown-it')({
html: true,
linkify: true,
typography: true
}).use(require('markdown-it-imsize')); // <-- this use(package_name) is required Example![test](image.png =100x200) is interpreted as <p><img src="image.png" alt="test" width="100" height="200"></p> OptionsAuto fillvar md = require('markdown-it')({
html: true,
linkify: true,
typography: true
}).use(require('markdown-it-imsize'), { autofill: true }); will fill the width and height fields automatically if the specified image path is valid. Therefore, ![test](image.png) is interpreted as <p><img src="image.png" alt="test" width="200" height="200"></p> where Use with RequireJS
bower install markdown-it-imsize Script for using require(['require', 'MarkdownIt', 'MarkdownItImsize'], function(require) {
var md = require('MarkdownIt')({
html: true,
linkify: true,
typography: true
}).use(require('MarkdownItImsize'));
var rendered = md.render("![test](test.jpg =100x)");
document.getElementById('image-box').innerHTML = rendered;
}); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论