mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
feat: add width and height and alt for img tag
This commit is contained in:
@@ -107,6 +107,7 @@ export const defaultTags = (function createTags() {
|
|||||||
toNode(
|
toNode(
|
||||||
"img",
|
"img",
|
||||||
{
|
{
|
||||||
|
...node.attrs,
|
||||||
src: render(node.content),
|
src: render(node.content),
|
||||||
},
|
},
|
||||||
null
|
null
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ describe('@bbob/preset-html5', () => {
|
|||||||
expect(parse(input)).toBe(result);
|
expect(parse(input)).toBe(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('[img width="100" height="50" alt="Lubeck city gate" title="This is one of the medieval city gates of Lubeck"]https://www.bbcode.org/images/lubeck_small.jpg[/img]', () => {
|
||||||
|
const input = '[img width="100" height="50" alt="Lubeck city gate" title="This is one of the medieval city gates of Lubeck"]https://www.bbcode.org/images/lubeck_small.jpg[/img]';
|
||||||
|
const result = '<img width="100" height="50" alt="Lubeck city gate" title="This is one of the medieval city gates of Lubeck" src="https://www.bbcode.org/images/lubeck_small.jpg"/>';
|
||||||
|
|
||||||
|
expect(parse(input)).toBe(result);
|
||||||
|
});
|
||||||
|
|
||||||
test('[quote="author"]quoted text[/quote]', () => {
|
test('[quote="author"]quoted text[/quote]', () => {
|
||||||
const input = '[quote="author"]quoted text[/quote]';
|
const input = '[quote="author"]quoted text[/quote]';
|
||||||
const result = '<blockquote><p>quoted text</p></blockquote>';
|
const result = '<blockquote><p>quoted text</p></blockquote>';
|
||||||
|
|||||||
Reference in New Issue
Block a user