@peaceroad/markdown-it-figure-with-p-caption 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -9
- package/index.js +122 -13
- package/package.json +3 -2
- package/test/examples-has-num-class.txt +31 -0
- package/test/examples-iframe-without-caption.txt +86 -0
- package/test/examples-img-alt-caption.txt +76 -0
- package/test/examples-img-title-caption.txt +92 -0
- package/test/examples-multiple-images.txt +140 -0
- package/test/{examples.txt → examples-no-option.txt} +9 -265
- package/test/examples-one-image-without-caption.txt +45 -0
- package/test/examples-video-without-caption.txt +11 -0
- package/test/test.js +140 -78
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ This is a markdown-it plugin.
|
|
|
4
4
|
|
|
5
5
|
For a paragraph with one image/images only, a table or code block or a blockquote or a iframe, and by writing a caption paragraph immediately before or after, they are converted into the figure element with the figcaption element.
|
|
6
6
|
|
|
7
|
-
1. Check that the element: one image only paragraph, table, code block, samp block, blockquote, and video.
|
|
7
|
+
1. Check that the element: one image only paragraph, table, code block, samp block, blockquote, and video, iframe.
|
|
8
8
|
2. Check if this element has a caption paragraph immediately before or after it
|
|
9
9
|
3. If there is the caption paragraph, convert them to figure and figcaption element.
|
|
10
10
|
|
|
@@ -17,12 +17,13 @@ Notice. It assumes simultaneous use of `markdown-it-attrs`. However, if there is
|
|
|
17
17
|
Use it as follows.
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import mdit from 'markdown-it'
|
|
21
|
+
import mditFigureWithPCaption from '@peaceroad/markdown-it-figure-with-p-caption'
|
|
22
22
|
|
|
23
|
-
md
|
|
23
|
+
const md = mdit()
|
|
24
|
+
md.use(mditFigureWithPCaption)
|
|
24
25
|
|
|
25
|
-
console.log(md.render('Figure. A Cat.\n\n')
|
|
26
|
+
console.log(md.render('Figure. A Cat.\n\n'))
|
|
26
27
|
// <figure class="f-img">
|
|
27
28
|
// <figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A Cat.</figcaption>
|
|
28
29
|
// <img src="cat.jpg" alt="Figure">
|
|
@@ -309,7 +310,7 @@ Note that a space is required between the file name and caption.
|
|
|
309
310
|
|
|
310
311
|
```js
|
|
311
312
|
|
|
312
|
-
md.use(
|
|
313
|
+
md.use(mditFigureWithPCaption, {dquoteFilename: true});
|
|
313
314
|
```
|
|
314
315
|
|
|
315
316
|
~~~
|
|
@@ -337,7 +338,7 @@ A paragraph.
|
|
|
337
338
|
### Use strong mark
|
|
338
339
|
|
|
339
340
|
```js
|
|
340
|
-
md.use(
|
|
341
|
+
md.use(mditFigureWithPCaption, {strongFilename: true});
|
|
341
342
|
```
|
|
342
343
|
|
|
343
344
|
~~~
|
|
@@ -370,7 +371,7 @@ A paragraph.
|
|
|
370
371
|
Convert one image paragraph without a caption paragraph to figure element.
|
|
371
372
|
|
|
372
373
|
```js
|
|
373
|
-
md.use(
|
|
374
|
+
md.use(mditFigureWithPCaption, {oneImageWithoutCaption: true});
|
|
374
375
|
```
|
|
375
376
|
|
|
376
377
|
~~~
|
|
@@ -389,12 +390,20 @@ A paragraph.
|
|
|
389
390
|
<p>A paragraph.</p>
|
|
390
391
|
~~~
|
|
391
392
|
|
|
393
|
+
### Convert one video element without caption
|
|
394
|
+
|
|
395
|
+
Convert one video element without a caption paragraph to figure element.
|
|
396
|
+
|
|
397
|
+
```js
|
|
398
|
+
md.use(mditFigureWithPCaption, {videoWithoutCaption: true});
|
|
399
|
+
```
|
|
400
|
+
|
|
392
401
|
#### Convert one iframe without caption
|
|
393
402
|
|
|
394
403
|
Convert one iframe without a caption paragraph to iframe element. (adn twitter blockquote embed eelment.)
|
|
395
404
|
|
|
396
405
|
```js
|
|
397
|
-
md.use(
|
|
406
|
+
md.use(mditFigureWithPCaption, {iframeWithoutCaption: true});
|
|
398
407
|
```
|
|
399
408
|
|
|
400
409
|
~~~
|
|
@@ -452,3 +461,47 @@ A paragraph.
|
|
|
452
461
|
<iframe class="speakerdeck-iframe" style="border: 0px none; background: rgba(0, 0, 0, 0.1) padding-box; margin: 0px; padding: 0px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 40px; width: 100%; height: auto; aspect-ratio: 560 / 314;" src="https://speakerdeck.com/player/xxxxxxxxxxxxxx" title="xxxxxxxxxxx" allowfullscreen="true" data-ratio="1.78343949044586" frameborder="0"></iframe>
|
|
453
462
|
</figure>
|
|
454
463
|
~~~
|
|
464
|
+
|
|
465
|
+
## Option: imgAltCaption
|
|
466
|
+
|
|
467
|
+
In Markdown documents, captions are often written in the alt attribute of images. If you follow the syntax of this plugin, the commit log will be cluttered. Therefore, as an option, the alt attribute is treated as a caption.
|
|
468
|
+
Note that you cannot use this plugin's syntax and this option's syntax at the same time.
|
|
469
|
+
|
|
470
|
+
Also (for now), this is translated into an actual HTML alt attribute with the caption label as its value.
|
|
471
|
+
|
|
472
|
+
```js
|
|
473
|
+
const mdImgAltCaption = mdit({html: true}).use(mditFigureWithPCaption, {imgAltCaption: 'Figure'})
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
```
|
|
477
|
+
[Markdown]
|
|
478
|
+

|
|
479
|
+
|
|
480
|
+
[HTML]
|
|
481
|
+
<figure class="f-img">
|
|
482
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
483
|
+
<img src="cat.jpg" alt="Figure">
|
|
484
|
+
</figure>
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
## Option: imgTitleCaption
|
|
488
|
+
|
|
489
|
+
The title attribute of the Markdown img element is used as the caption.
|
|
490
|
+
Note that you cannot use this plugin's syntax and this option's syntax at the same time.
|
|
491
|
+
|
|
492
|
+
Also(for now), the alt attribute is not specially modified during conversion; the Markdown alt attribute is used as is.
|
|
493
|
+
|
|
494
|
+
```js
|
|
495
|
+
const mdImgAltCaption = mdit({html: true}).use(mditFigureWithPCaption, {imgTitleCaption: 'Figure'})
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
```
|
|
499
|
+
[Markdown]
|
|
500
|
+

|
|
501
|
+
|
|
502
|
+
[HTML]
|
|
503
|
+
<figure class="f-img">
|
|
504
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
505
|
+
<img src="cat.jpg" alt="A alt text.">
|
|
506
|
+
</figure>
|
|
507
|
+
```
|
package/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import mditPCaption from 'p7d-markdown-it-p-captions'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const mdPCaption = require('p7d-markdown-it-p-captions');
|
|
3
|
+
const mditFigureWithPCaption = (md, option) => {
|
|
6
4
|
|
|
7
5
|
let opt = {
|
|
8
6
|
classPrefix: 'f',
|
|
@@ -15,10 +13,13 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
15
13
|
jointSpaceUseHalfWidth: false,
|
|
16
14
|
oneImageWithoutCaption: false,
|
|
17
15
|
iframeWithoutCaption: false,
|
|
16
|
+
videoWithoutCaption: false,
|
|
18
17
|
removeUnnumberedLabel: false,
|
|
19
18
|
removeUnnumberedLabelExceptMarks: [],
|
|
20
19
|
multipleImages: true,
|
|
21
20
|
styleProcess: true,
|
|
21
|
+
imgAltCaption: false,
|
|
22
|
+
imgTitleCaption: false,
|
|
22
23
|
};
|
|
23
24
|
if (option !== undefined) {
|
|
24
25
|
for (let o in option) {
|
|
@@ -69,7 +70,6 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
69
70
|
|
|
70
71
|
captionEndToken.type = 'figcaption_close';
|
|
71
72
|
captionEndToken.tag = 'figcaption';
|
|
72
|
-
|
|
73
73
|
state.tokens.splice(n + 2, 0, captionStartToken, captionInlineToken, captionEndToken);
|
|
74
74
|
state.tokens.splice(n-3, 3);
|
|
75
75
|
return true;
|
|
@@ -130,7 +130,10 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
130
130
|
const figureStartToken = new state.Token('figure_open', 'figure', 1);
|
|
131
131
|
figureStartToken.attrSet('class', 'f-' + tagName);
|
|
132
132
|
if (sp) {
|
|
133
|
-
if (sp.
|
|
133
|
+
if (sp.isYoutube) {
|
|
134
|
+
figureStartToken.attrSet('class', 'f-video');
|
|
135
|
+
}
|
|
136
|
+
if (sp.isTwitter) {
|
|
134
137
|
if (sp.hasImgCaption) {
|
|
135
138
|
figureStartToken.attrSet('class', 'f-img');
|
|
136
139
|
} else {
|
|
@@ -175,6 +178,7 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
function checkCaption(state, n, en, tagName, caption) {
|
|
181
|
+
|
|
178
182
|
caption = checkPrevCaption(state, n, en, tagName, caption);
|
|
179
183
|
if (caption.hasPrev) return caption;
|
|
180
184
|
caption = checkNextCaption(state, n, en, tagName, caption);
|
|
@@ -263,12 +267,12 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
263
267
|
tagName = tags[ctj];
|
|
264
268
|
if (tagName === 'iframe') {
|
|
265
269
|
if(/^<[^>]*? src="https:\/\/(?:www.youtube-nocookie.com|player.vimeo.com)\//i.test(token.content)) {
|
|
266
|
-
|
|
270
|
+
sp.isYoutube = true;
|
|
267
271
|
}
|
|
268
272
|
}
|
|
269
273
|
if (tagName === 'blockquote') {
|
|
270
274
|
if(/^<[^>]*? class="twitter-tweet"/.test(token.content)) {
|
|
271
|
-
sp.
|
|
275
|
+
sp.isTwitter = true;
|
|
272
276
|
if (n > 2) {
|
|
273
277
|
if (state.tokens[n-2].children.length > 1) {
|
|
274
278
|
if (state.tokens[n-2].children[1].attrs.length > 0) {
|
|
@@ -300,9 +304,11 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
300
304
|
}
|
|
301
305
|
checkToken = true;
|
|
302
306
|
caption = checkCaption(state, n, en, tagName, caption);
|
|
303
|
-
if (
|
|
307
|
+
if (caption.hasPrev || caption.hasNext ||
|
|
308
|
+
(opt.iframeWithoutCaption && (tagName === 'iframe' || sp.isTwitter)) ||
|
|
309
|
+
(opt.videoWithoutCaption && tagName === 'video')) {
|
|
304
310
|
range = wrapWithFigure(state, range, tagName, false, sp);
|
|
305
|
-
if (opt.iframeWithoutCaption && (!caption.hasPrev || !caption.hasNext)) {
|
|
311
|
+
if ((opt.videoWithoutCaption || opt.iframeWithoutCaption) && (!caption.hasPrev || !caption.hasNext)) {
|
|
306
312
|
n = en + 2;
|
|
307
313
|
}
|
|
308
314
|
break;
|
|
@@ -387,7 +393,12 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
387
393
|
range.end = en;
|
|
388
394
|
tagName = 'img';
|
|
389
395
|
nextToken.children[0].type = 'image';
|
|
390
|
-
|
|
396
|
+
|
|
397
|
+
if (opt.imgAltCaption) setAltToLabel(state, n, en, tagName, caption, opt)
|
|
398
|
+
if (opt.imgTitleCaption) setTitleToLabel(state, n, en, tagName, caption, opt)
|
|
399
|
+
|
|
400
|
+
caption = checkCaption(state, n, en, tagName, caption, opt);
|
|
401
|
+
|
|
391
402
|
if (opt.oneImageWithoutCaption && state.tokens[n-1]) {
|
|
392
403
|
if (state.tokens[n-1].type === 'list_item_open') {checkToken = false;}
|
|
393
404
|
}
|
|
@@ -420,7 +431,103 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
420
431
|
return;
|
|
421
432
|
}
|
|
422
433
|
|
|
423
|
-
|
|
434
|
+
const setAltToLabel = (state, n, en, tagName, caption, opt) => {
|
|
435
|
+
if (n < 2) return false
|
|
436
|
+
if (state.tokens[n+1].children[0].type === 'image') {
|
|
437
|
+
if (state.tokens[n-2].children[2]) {
|
|
438
|
+
state.tokens[n+1].content = state.tokens[n+1].content.replace(/^!\[.*?\]/, '![' + state.tokens[n-2].children[2].content + ']')
|
|
439
|
+
if (!state.tokens[n+1].children[0].children[0]) {
|
|
440
|
+
const textToken = new state.Token('text', '', 0)
|
|
441
|
+
state.tokens[n+1].children[0].children.push(textToken)
|
|
442
|
+
}
|
|
443
|
+
state.tokens[n+1].children[0].content = state.tokens[n-2].children[2].content
|
|
444
|
+
state.tokens[n+1].children[0].children[0].content = state.tokens[n-2].children[2].content
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
//console.log(state.tokens[n+1].children[0])
|
|
448
|
+
return true
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const setTitleToLabel = (state, n, en, tagName, caption, opt) => {
|
|
452
|
+
if (n < 2) return false
|
|
453
|
+
if (state.tokens[n+1].children[0].type === 'image') {
|
|
454
|
+
if (state.tokens[n-2].children[0]) {
|
|
455
|
+
state.tokens[n+1].children[0].attrSet('alt', state.tokens[n+1].children[0].content)
|
|
456
|
+
if (!state.tokens[n+1].children[0].children[0]) {
|
|
457
|
+
const textToken = new state.Token('text', '', 0)
|
|
458
|
+
state.tokens[n+1].children[0].children.push(textToken)
|
|
459
|
+
}
|
|
460
|
+
let i = 0
|
|
461
|
+
while (0 < state.tokens[n+1].children[0].attrs.length) {
|
|
462
|
+
if (state.tokens[n+1].children[0].attrs[i][0] === 'title') {
|
|
463
|
+
state.tokens[n+1].children[0].attrs.splice(i, i + 1)
|
|
464
|
+
break
|
|
465
|
+
} else {
|
|
466
|
+
state.tokens[n+1].children[0].attrJoin('title', '')
|
|
467
|
+
}
|
|
468
|
+
i++
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
//console.log(state.tokens[n+1].children[0])
|
|
473
|
+
return true
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
const imgAttrToPCaption = (state, startLine) => {
|
|
477
|
+
let pos = state.bMarks[startLine] + state.tShift[startLine]
|
|
478
|
+
let max = state.eMarks[startLine]
|
|
479
|
+
let inline = state.src.slice(pos, max)
|
|
480
|
+
let label = ''
|
|
481
|
+
if (opt.imgAltCaption && typeof opt.imgAltCaption === 'string') label = opt.imgAltCaption
|
|
482
|
+
if (opt.imgTitleCaption && typeof opt.imgTitleCaption === 'string') label = opt.imgTitleCaption
|
|
483
|
+
let caption = ''
|
|
484
|
+
|
|
485
|
+
const img = inline.match(/^( *!\[)(.*?)\]\( *?((.*?)(?: +?\"(.*?)\")?) *?\)( *?\{.*?\})? *$/)
|
|
486
|
+
if (!img) return
|
|
487
|
+
|
|
488
|
+
let hasLabel
|
|
489
|
+
if (opt.imgAltCaption) {
|
|
490
|
+
caption = img[2]
|
|
491
|
+
hasLabel = img[2].match(new RegExp('^' + opt.imgAltCaption))
|
|
492
|
+
}
|
|
493
|
+
if (opt.imgTitleCaption) {
|
|
494
|
+
if (!img[5]) img[5] = ''
|
|
495
|
+
caption = img[5]
|
|
496
|
+
hasLabel = img[5].match(new RegExp('^' + opt.imgTitleCaption))
|
|
497
|
+
}
|
|
498
|
+
let token
|
|
499
|
+
token = state.push('paragraph_open', 'p', 1)
|
|
500
|
+
token.map = [startLine, startLine + 1]
|
|
501
|
+
token = state.push('inline', '', 0)
|
|
502
|
+
|
|
503
|
+
if (hasLabel) {
|
|
504
|
+
token.content = caption
|
|
505
|
+
} else {
|
|
506
|
+
if (label) {
|
|
507
|
+
token.content = label
|
|
508
|
+
if (/[a-zA-Z]/.test(label)) {
|
|
509
|
+
token.content += '.'
|
|
510
|
+
if (caption) token.content += ' '
|
|
511
|
+
} else {
|
|
512
|
+
token.content += ' '
|
|
513
|
+
}
|
|
514
|
+
token.content += caption
|
|
515
|
+
} else {
|
|
516
|
+
token.content = caption
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
//console.log('token.content: ' + token.content)
|
|
520
|
+
token.map = [startLine, startLine + 1]
|
|
521
|
+
token.children = []
|
|
522
|
+
token = state.push('paragraph_close', 'p', -1)
|
|
523
|
+
return
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
if (opt.imgAltCaption || opt.imgTitleCaption) {
|
|
528
|
+
md.block.ruler.before('paragraph', 'img_attr_caption', imgAttrToPCaption)
|
|
529
|
+
}
|
|
530
|
+
md.use(mditPCaption, {
|
|
424
531
|
classPrefix: opt.classPrefix,
|
|
425
532
|
dquoteFilename: opt.dquoteFilename,
|
|
426
533
|
strongFilename: opt.strongFilename,
|
|
@@ -430,7 +537,7 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
430
537
|
jointSpaceUseHalfWidth: opt.jointSpaceUseHalfWidth,
|
|
431
538
|
removeUnnumberedLabel: opt.removeUnnumberedLabel,
|
|
432
539
|
removeUnnumberedLabelExceptMarks: opt.removeUnnumberedLabelExceptMarks,
|
|
433
|
-
})
|
|
540
|
+
})
|
|
434
541
|
md.core.ruler.before('linkify', 'figure_with_caption', figureWithCaption);
|
|
435
542
|
md.renderer.rules['fence_samp'] = function (tokens, idx, options, env, slf) {
|
|
436
543
|
const token = tokens[idx];
|
|
@@ -445,3 +552,5 @@ module.exports = function figure_with_caption_plugin(md, option) {
|
|
|
445
552
|
return '<pre>' + sampStartTag + md.utils.escapeHtml(token.content) + '</samp></pre>\n';
|
|
446
553
|
};
|
|
447
554
|
};
|
|
555
|
+
|
|
556
|
+
export default mditFigureWithPCaption
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peaceroad/markdown-it-figure-with-p-caption",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A markdown-it plugin. For a paragraph with only one image, a table or code block or blockquote, and by writing a caption paragraph immediately before or after, they are converted into the figure element with the figcaption element.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "node test/test.js"
|
|
8
9
|
},
|
|
@@ -17,6 +18,6 @@
|
|
|
17
18
|
"markdown-it-attrs": "^4.1.6"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
|
-
"p7d-markdown-it-p-captions": "^0.
|
|
21
|
+
"p7d-markdown-it-p-captions": "^0.13.0"
|
|
21
22
|
}
|
|
22
23
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[Markdown]
|
|
2
|
+
Figure 12. A cat.
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
[HTML]
|
|
7
|
+
<figure class="f-img">
|
|
8
|
+
<figcaption><span class="f-img-label label-has-num">Figure 12<span class="f-img-label-joint">.</span></span> A cat.</figcaption>
|
|
9
|
+
<img src="cat.jpg" alt="Figure">
|
|
10
|
+
</figure>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
[Markdown]
|
|
14
|
+
A paragraph.
|
|
15
|
+
|
|
16
|
+
リスト1 キャプション
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
console.log('Nyaan!');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
A paragraph.
|
|
23
|
+
|
|
24
|
+
[HTML]
|
|
25
|
+
<p>A paragraph.</p>
|
|
26
|
+
<figure class="f-pre-code" role="doc-example">
|
|
27
|
+
<figcaption><span class="f-pre-code-label label-has-num">リスト1</span> キャプション</figcaption>
|
|
28
|
+
<pre><code class="language-js">console.log('Nyaan!');
|
|
29
|
+
</code></pre>
|
|
30
|
+
</figure>
|
|
31
|
+
<p>A paragraph.</p>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[Markdown]
|
|
2
|
+
A paragraph.
|
|
3
|
+
|
|
4
|
+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/XXXXXXXXXXX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
5
|
+
|
|
6
|
+
A paragraph.
|
|
7
|
+
[HTML]
|
|
8
|
+
<p>A paragraph.</p>
|
|
9
|
+
<figure class="f-video">
|
|
10
|
+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/XXXXXXXXXXX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
11
|
+
</figure>
|
|
12
|
+
<p>A paragraph.</p>
|
|
13
|
+
|
|
14
|
+
[Markdown]
|
|
15
|
+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/XXXXXXXXXXX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
16
|
+
[HTML]
|
|
17
|
+
<figure class="f-video">
|
|
18
|
+
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/XXXXXXXXXXX" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
19
|
+
</figure>
|
|
20
|
+
|
|
21
|
+
[Markdown]
|
|
22
|
+
<iframe src="https://example.com/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script src="https://exapmle.com/embed.js" async="async"></script>
|
|
23
|
+
[HTML]
|
|
24
|
+
<figure class="f-iframe">
|
|
25
|
+
<iframe src="https://example.com/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script src="https://exapmle.com/embed.js" async="async"></script>
|
|
26
|
+
</figure>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
[Markdown]
|
|
31
|
+
<iframe class="speakerdeck-iframe" style="border: 0px none; background: rgba(0, 0, 0, 0.1) padding-box; margin: 0px; padding: 0px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 40px; width: 100%; height: auto; aspect-ratio: 560 / 314;" src="https://speakerdeck.com/player/xxxxxxxxxxxxxx" title="xxxxxxxxxxx" allowfullscreen="true" data-ratio="1.78343949044586" frameborder="0"></iframe>
|
|
32
|
+
[HTML]
|
|
33
|
+
<figure class="f-iframe">
|
|
34
|
+
<iframe class="speakerdeck-iframe" style="border: 0px none; background: rgba(0, 0, 0, 0.1) padding-box; margin: 0px; padding: 0px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 40px; width: 100%; height: auto; aspect-ratio: 560 / 314;" src="https://speakerdeck.com/player/xxxxxxxxxxxxxx" title="xxxxxxxxxxx" allowfullscreen="true" data-ratio="1.78343949044586" frameborder="0"></iframe>
|
|
35
|
+
</figure>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[Markdown]
|
|
40
|
+
Slide. A caption.
|
|
41
|
+
|
|
42
|
+
<iframe class="speakerdeck-iframe" style="border: 0px none; background: rgba(0, 0, 0, 0.1) padding-box; margin: 0px; padding: 0px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 40px; width: 100%; height: auto; aspect-ratio: 560 / 314;" src="https://speakerdeck.com/player/xxxxxxxxxxxxxx" title="xxxxxxxxxxx" allowfullscreen="true" data-ratio="1.78343949044586" frameborder="0"></iframe>
|
|
43
|
+
[HTML]
|
|
44
|
+
<figure class="f-iframe">
|
|
45
|
+
<figcaption><span class="f-slide-label">Slide<span class="f-slide-label-joint">.</span></span> A caption.</figcaption>
|
|
46
|
+
<iframe class="speakerdeck-iframe" style="border: 0px none; background: rgba(0, 0, 0, 0.1) padding-box; margin: 0px; padding: 0px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 40px; width: 100%; height: auto; aspect-ratio: 560 / 314;" src="https://speakerdeck.com/player/xxxxxxxxxxxxxx" title="xxxxxxxxxxx" allowfullscreen="true" data-ratio="1.78343949044586" frameborder="0"></iframe>
|
|
47
|
+
</figure>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
[Markdown]
|
|
51
|
+
<iframe src="https://player.vimeo.com/video/xxxxxxxxxxxxxxx" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
|
|
52
|
+
<p><a href="https://vimeo.com/xxxx">Title</a> from <a href="https://vimeo.com/yyy">User</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
|
|
53
|
+
[HTML]
|
|
54
|
+
<figure class="f-video">
|
|
55
|
+
<iframe src="https://player.vimeo.com/video/xxxxxxxxxxxxxxx" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
|
|
56
|
+
<p><a href="https://vimeo.com/xxxx">Title</a> from <a href="https://vimeo.com/yyy">User</a> on <a href="https://vimeo.com">Vimeo</a>.</p></figure>
|
|
57
|
+
|
|
58
|
+
[Markdown]
|
|
59
|
+
<iframe src="https://player.vimeo.com/video/xxxxxxxxxxxxxxx" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
|
|
60
|
+
[HTML]
|
|
61
|
+
<figure class="f-video">
|
|
62
|
+
<iframe src="https://player.vimeo.com/video/xxxxxxxxxxxxxxx" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
|
|
63
|
+
</figure>
|
|
64
|
+
|
|
65
|
+
[Markdown]
|
|
66
|
+
A paragraph. iframeWithoutCaption: true.
|
|
67
|
+
|
|
68
|
+
<blockquote class="twitter-tweet"><p lang="ja" dir="ltr">XXXXX <a href="https://t.co/XXXXX">https://t.co/XXXXX</a></p>— User (@twitter) <a href="https://twitter.com/UserID/status/XXXXX">August 4, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
|
69
|
+
|
|
70
|
+
A paragraph.
|
|
71
|
+
[HTML]
|
|
72
|
+
<p>A paragraph. iframeWithoutCaption: true.</p>
|
|
73
|
+
<figure class="f-iframe">
|
|
74
|
+
<blockquote class="twitter-tweet"><p lang="ja" dir="ltr">XXXXX <a href="https://t.co/XXXXX">https://t.co/XXXXX</a></p>— User (@twitter) <a href="https://twitter.com/UserID/status/XXXXX">August 4, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
|
75
|
+
</figure>
|
|
76
|
+
<p>A paragraph.</p>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
[Markdown]
|
|
80
|
+
<blockquote class="twitter-tweet"><p lang="ja" dir="ltr">XXXXX <a href="https://t.co/XXXXX">https://t.co/XXXXX</a></p>— User (@twitter) <a href="https://twitter.com/UserID/status/XXXXX">August 4, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
|
81
|
+
[HTML]
|
|
82
|
+
<figure class="f-iframe">
|
|
83
|
+
<blockquote class="twitter-tweet"><p lang="ja" dir="ltr">XXXXX <a href="https://t.co/XXXXX">https://t.co/XXXXX</a></p>— User (@twitter) <a href="https://twitter.com/UserID/status/XXXXX">August 4, 2022</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
|
84
|
+
</figure>
|
|
85
|
+
|
|
86
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[Markdown]
|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
[HTML]
|
|
5
|
+
<figure class="f-img">
|
|
6
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
7
|
+
<img src="cat.jpg" alt="Figure">
|
|
8
|
+
</figure>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
[Markdown]
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
[HTML]
|
|
15
|
+
<figure class="f-img">
|
|
16
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
17
|
+
<img src="cat.jpg" alt="Figure">
|
|
18
|
+
</figure>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[Markdown]
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
[HTML]
|
|
25
|
+
<figure class="f-img">
|
|
26
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span></figcaption>
|
|
27
|
+
<img src="cat.jpg" alt="Figure">
|
|
28
|
+
</figure>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[Markdown]
|
|
32
|
+
Figure. A caption.
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
[HTML]
|
|
37
|
+
<p class="f-img"><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</p>
|
|
38
|
+
<figure class="f-img">
|
|
39
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span></figcaption>
|
|
40
|
+
<img src="cat.jpg" alt="Figure">
|
|
41
|
+
</figure>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
[Markdown]
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
[HTML]
|
|
48
|
+
<figure class="f-img">
|
|
49
|
+
<figcaption><span class="f-img-label">Figure 12<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
50
|
+
<img src="cat.jpg" alt="Figure 12">
|
|
51
|
+
</figure>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
[Markdown]
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
[HTML]
|
|
58
|
+
<figure class="f-img">
|
|
59
|
+
<figcaption><span class="f-img-label">図1<span class="f-img-label-joint"> </span></span>キャプション</figcaption>
|
|
60
|
+
<img src="cat.jpg" alt="図1">
|
|
61
|
+
</figure>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
[Markdown]
|
|
65
|
+
図 キャプション
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
[HTML]
|
|
70
|
+
<p class="f-img"><span class="f-img-label">図</span> キャプション</p>
|
|
71
|
+
<figure class="f-img">
|
|
72
|
+
<figcaption><span class="f-img-label">図1<span class="f-img-label-joint"> </span></span>キャプション</figcaption>
|
|
73
|
+
<img src="cat.jpg" alt="図1">
|
|
74
|
+
</figure>
|
|
75
|
+
|
|
76
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
[Markdown]
|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
[HTML]
|
|
5
|
+
<figure class="f-img">
|
|
6
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
7
|
+
<img src="cat.jpg" alt="">
|
|
8
|
+
</figure>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
[Markdown]
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
[HTML]
|
|
15
|
+
<figure class="f-img">
|
|
16
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
17
|
+
<img src="cat.jpg" alt="">
|
|
18
|
+
</figure>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[Markdown]
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
[HTML]
|
|
25
|
+
<figure class="f-img">
|
|
26
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span></figcaption>
|
|
27
|
+
<img src="cat.jpg" alt="A alt text.">
|
|
28
|
+
</figure>
|
|
29
|
+
|
|
30
|
+
[Markdown]
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
[HTML]
|
|
34
|
+
<figure class="f-img">
|
|
35
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span></figcaption>
|
|
36
|
+
<img src="cat.jpg" alt="A alt text.">
|
|
37
|
+
</figure>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
[Markdown]
|
|
41
|
+
Figure. A caption.
|
|
42
|
+
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
[HTML]
|
|
46
|
+
<p class="f-img"><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</p>
|
|
47
|
+
<figure class="f-img">
|
|
48
|
+
<figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span></figcaption>
|
|
49
|
+
<img src="cat.jpg" alt="">
|
|
50
|
+
</figure>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
[Markdown]
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
[HTML]
|
|
57
|
+
<figure class="f-img">
|
|
58
|
+
<figcaption><span class="f-img-label">Figure 12<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
|
|
59
|
+
<img src="cat.jpg" alt="">
|
|
60
|
+
</figure>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
[Markdown]
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
[HTML]
|
|
67
|
+
<figure class="f-img">
|
|
68
|
+
<figcaption><span class="f-img-label">図1<span class="f-img-label-joint"> </span></span>キャプション</figcaption>
|
|
69
|
+
<img src="cat.jpg" alt="猫">
|
|
70
|
+
</figure>
|
|
71
|
+
|
|
72
|
+
[Markdown]
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
[HTML]
|
|
76
|
+
<figure class="f-img">
|
|
77
|
+
<figcaption><span class="f-img-label">図</span> キャプション</figcaption>
|
|
78
|
+
<img src="cat.jpg" alt="">
|
|
79
|
+
</figure>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
[Markdown]
|
|
83
|
+
図 キャプション
|
|
84
|
+
|
|
85
|
+

|
|
86
|
+
|
|
87
|
+
[HTML]
|
|
88
|
+
<p class="f-img"><span class="f-img-label">図</span> キャプション</p>
|
|
89
|
+
<figure class="f-img">
|
|
90
|
+
<figcaption><span class="f-img-label">図23</span> Caption</figcaption>
|
|
91
|
+
<img src="cat.jpg" alt="猫">
|
|
92
|
+
</figure>
|