@peaceroad/markdown-it-figure-with-p-caption 0.5.3 → 0.6.1

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 CHANGED
@@ -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
- const md = require('markdown-it')();
21
- const mdFigureWithPCaption = require('@peaceroad/markdown-it-figure-with-p-caption');
20
+ import mdit from 'markdown-it'
21
+ import mditFigureWithPCaption from '@peaceroad/markdown-it-figure-with-p-caption'
22
22
 
23
- md.use(mdFigureWithPCaption);
23
+ const md = mdit()
24
+ md.use(mditFigureWithPCaption)
24
25
 
25
- console.log(md.render('Figure. A Cat.\n\n![Figure](cat.jpg)');
26
+ console.log(md.render('Figure. A Cat.\n\n![Figure](cat.jpg)'))
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(mdFigureWithPCaption, {dquoteFilename: true});
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(mdFigureWithPCaption, {strongFilename: true});
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(mdFigureWithPCaption, {oneImageWithoutCaption: true});
374
+ md.use(mditFigureWithPCaption, {oneImageWithoutCaption: true});
374
375
  ```
375
376
 
376
377
  ~~~
@@ -394,7 +395,7 @@ A paragraph.
394
395
  Convert one video element without a caption paragraph to figure element.
395
396
 
396
397
  ```js
397
- md.use(mdFigureWithPCaption, {videoWithoutCaption: true});
398
+ md.use(mditFigureWithPCaption, {videoWithoutCaption: true});
398
399
  ```
399
400
 
400
401
  #### Convert one iframe without caption
@@ -402,7 +403,7 @@ md.use(mdFigureWithPCaption, {videoWithoutCaption: true});
402
403
  Convert one iframe without a caption paragraph to iframe element. (adn twitter blockquote embed eelment.)
403
404
 
404
405
  ```js
405
- md.use(mdFigureWithPCaption, {iframeWithoutCaption: true});
406
+ md.use(mditFigureWithPCaption, {iframeWithoutCaption: true});
406
407
  ```
407
408
 
408
409
  ~~~
@@ -460,3 +461,47 @@ A paragraph.
460
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>
461
462
  </figure>
462
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
+ ![Figure. A caption.](cat.jpg)
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
+ ![A alt text.](cat.jpg "Figure. A caption.")
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
- 'use strict';
1
+ import mditPCaption from 'p7d-markdown-it-p-captions'
2
2
 
3
- module.exports = function figure_with_caption_plugin(md, option) {
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',
@@ -20,6 +18,8 @@ module.exports = function figure_with_caption_plugin(md, option) {
20
18
  removeUnnumberedLabelExceptMarks: [],
21
19
  multipleImages: true,
22
20
  styleProcess: true,
21
+ imgAltCaption: false,
22
+ imgTitleCaption: false,
23
23
  };
24
24
  if (option !== undefined) {
25
25
  for (let o in option) {
@@ -57,6 +57,19 @@ module.exports = function figure_with_caption_plugin(md, option) {
57
57
  const captionStartToken = state.tokens[n-3];
58
58
  const captionInlineToken = state.tokens[n-2];
59
59
  const captionEndToken = state.tokens[n-1];
60
+ let isNoCaption = false
61
+ if (captionInlineToken.attrs) {
62
+ for (let attr of captionInlineToken.attrs) {
63
+ if (attr[0] === 'class' && attr[1] === 'nocaption') {
64
+ isNoCaption = true
65
+ }
66
+ }
67
+ }
68
+ if (isNoCaption) {
69
+ state.tokens.splice(n-3, 3)
70
+ return
71
+ }
72
+
60
73
  captionStartToken.attrs.forEach(attr => {
61
74
  if (attr[0] === 'class') {
62
75
  attr[1] = attr[1].replace(new RegExp(' *?f-' + caption.name), '').trim();
@@ -70,7 +83,6 @@ module.exports = function figure_with_caption_plugin(md, option) {
70
83
 
71
84
  captionEndToken.type = 'figcaption_close';
72
85
  captionEndToken.tag = 'figcaption';
73
-
74
86
  state.tokens.splice(n + 2, 0, captionStartToken, captionInlineToken, captionEndToken);
75
87
  state.tokens.splice(n-3, 3);
76
88
  return true;
@@ -179,6 +191,7 @@ module.exports = function figure_with_caption_plugin(md, option) {
179
191
  }
180
192
 
181
193
  function checkCaption(state, n, en, tagName, caption) {
194
+
182
195
  caption = checkPrevCaption(state, n, en, tagName, caption);
183
196
  if (caption.hasPrev) return caption;
184
197
  caption = checkNextCaption(state, n, en, tagName, caption);
@@ -393,7 +406,12 @@ module.exports = function figure_with_caption_plugin(md, option) {
393
406
  range.end = en;
394
407
  tagName = 'img';
395
408
  nextToken.children[0].type = 'image';
396
- caption = checkCaption(state, n, en, tagName, caption);
409
+
410
+ if (opt.imgAltCaption) setAltToLabel(state, n, en, tagName, caption, opt)
411
+ if (opt.imgTitleCaption) setTitleToLabel(state, n, en, tagName, caption, opt)
412
+
413
+ caption = checkCaption(state, n, en, tagName, caption, opt);
414
+
397
415
  if (opt.oneImageWithoutCaption && state.tokens[n-1]) {
398
416
  if (state.tokens[n-1].type === 'list_item_open') {checkToken = false;}
399
417
  }
@@ -426,7 +444,114 @@ module.exports = function figure_with_caption_plugin(md, option) {
426
444
  return;
427
445
  }
428
446
 
429
- md.use(mdPCaption, {
447
+ const setAltToLabel = (state, n, en, tagName, caption, opt) => {
448
+ if (n < 2) return false
449
+ if (state.tokens[n+1].children[0].type !== 'image' || !state.tokens[n-2].children) return false
450
+ if (state.tokens[n-2].children[2]) {
451
+ state.tokens[n+1].content = state.tokens[n+1].content.replace(/^!\[.*?\]/, '![' + state.tokens[n-2].children[2].content + ']')
452
+ if (!state.tokens[n+1].children[0].children[0]) {
453
+ const textToken = new state.Token('text', '', 0)
454
+ state.tokens[n+1].children[0].children.push(textToken)
455
+ }
456
+ // Set figure label:
457
+ //state.tokens[n+1].children[0].children[0].content = state.tokens[n-2].children[2].content
458
+ // Set img alt to empty value:
459
+ state.tokens[n+1].children[0].children[0].content = ''
460
+ }
461
+ // Set figure label:
462
+ //state.tokens[n+1].children[0].content = state.tokens[n-2].children[2].content
463
+ // Set img alt to empty value:
464
+ state.tokens[n+1].children[0].content = ''
465
+ //console.log(state.tokens[n+1].children[0])
466
+ return true
467
+ }
468
+
469
+ const setTitleToLabel = (state, n, en, tagName, caption, opt) => {
470
+ if (n < 2) return false
471
+ if (state.tokens[n+1].children[0].type !== 'image') return false
472
+ if (!state.tokens[n-2].children[0]) return false
473
+ state.tokens[n+1].children[0].attrSet('alt', state.tokens[n+1].children[0].content)
474
+ if (!state.tokens[n+1].children[0].children[0]) {
475
+ const textToken = new state.Token('text', '', 0)
476
+ state.tokens[n+1].children[0].children.push(textToken)
477
+ }
478
+ let i = 0
479
+ while (0 < state.tokens[n+1].children[0].attrs.length) {
480
+ if (state.tokens[n+1].children[0].attrs[i][0] === 'title') {
481
+ state.tokens[n+1].children[0].attrs.splice(i, i + 1)
482
+ break
483
+ } else {
484
+ state.tokens[n+1].children[0].attrJoin('title', '')
485
+ }
486
+ i++
487
+ }
488
+ //console.log(state.tokens[n+1].children[0])
489
+ return true
490
+ }
491
+
492
+ const imgAttrToPCaption = (state, startLine) => {
493
+ let pos = state.bMarks[startLine] + state.tShift[startLine]
494
+ let max = state.eMarks[startLine]
495
+ let inline = state.src.slice(pos, max)
496
+ let label = ''
497
+ if (opt.imgAltCaption && typeof opt.imgAltCaption === 'string') label = opt.imgAltCaption
498
+ if (opt.imgTitleCaption && typeof opt.imgTitleCaption === 'string') label = opt.imgTitleCaption
499
+ let caption = ''
500
+ let imgAttrUsedCaption = ''
501
+
502
+ const img = inline.match(/^( *!\[)(.*?)\]\( *?((.*?)(?: +?\"(.*?)\")?) *?\)( *?\{.*?\})? *$/)
503
+ if (!img) return
504
+
505
+ let hasLabel
506
+ if (opt.imgAltCaption) {
507
+ caption = img[2]
508
+ hasLabel = img[2].match(new RegExp('^' + opt.imgAltCaption))
509
+ imgAttrUsedCaption = 'alt'
510
+ }
511
+ if (opt.imgTitleCaption) {
512
+ if (!img[5]) img[5] = ''
513
+ caption = img[5]
514
+ hasLabel = img[5].match(new RegExp('^' + opt.imgTitleCaption))
515
+ imgAttrUsedCaption = 'title'
516
+ }
517
+ let token
518
+ token = state.push('paragraph_open', 'p', 1)
519
+ token.map = [startLine, startLine + 1]
520
+ token = state.push('inline', '', 0)
521
+ if (hasLabel) {
522
+ token.content = caption
523
+ } else {
524
+ if (!label) {
525
+ if (imgAttrUsedCaption === 'alt') {
526
+ label = opt.imgAltCaption
527
+ } else if (imgAttrUsedCaption === 'title') {
528
+ label = opt.imgTitleCaption
529
+ } else if (imgAttrUsedCaption) {
530
+ label = 'Figure'
531
+ }
532
+ }
533
+ token.content = label
534
+ if (/[a-zA-Z]/.test(label)) {
535
+ token.content += '.'
536
+ if (caption) token.content += ' '
537
+ } else {
538
+ token.content += ' '
539
+ }
540
+ token.content += caption
541
+ }
542
+ token.map = [startLine, startLine + 1]
543
+ token.children = []
544
+ if (caption.length === 0) {
545
+ token.attrs = [['class', 'nocaption']]
546
+ }
547
+ token = state.push('paragraph_close', 'p', -1)
548
+ return
549
+ }
550
+
551
+ if (opt.imgAltCaption || opt.imgTitleCaption) {
552
+ md.block.ruler.before('paragraph', 'img_attr_caption', imgAttrToPCaption)
553
+ }
554
+ md.use(mditPCaption, {
430
555
  classPrefix: opt.classPrefix,
431
556
  dquoteFilename: opt.dquoteFilename,
432
557
  strongFilename: opt.strongFilename,
@@ -436,7 +561,7 @@ module.exports = function figure_with_caption_plugin(md, option) {
436
561
  jointSpaceUseHalfWidth: opt.jointSpaceUseHalfWidth,
437
562
  removeUnnumberedLabel: opt.removeUnnumberedLabel,
438
563
  removeUnnumberedLabelExceptMarks: opt.removeUnnumberedLabelExceptMarks,
439
- });
564
+ })
440
565
  md.core.ruler.before('linkify', 'figure_with_caption', figureWithCaption);
441
566
  md.renderer.rules['fence_samp'] = function (tokens, idx, options, env, slf) {
442
567
  const token = tokens[idx];
@@ -451,3 +576,5 @@ module.exports = function figure_with_caption_plugin(md, option) {
451
576
  return '<pre>' + sampStartTag + md.utils.escapeHtml(token.content) + '</samp></pre>\n';
452
577
  };
453
578
  };
579
+
580
+ 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.5.3",
3
+ "version": "0.6.1",
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.12.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
+ ![Figure](cat.jpg)
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>&mdash; 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>&mdash; 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>&mdash; 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>&mdash; 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,89 @@
1
+ [Markdown]
2
+ ![A caption.](cat.jpg)
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
+ ![Figure. A caption.](cat.jpg)
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
+ ![](cat.jpg)
23
+
24
+ [HTML]
25
+ <figure class="f-img">
26
+ <img src="cat.jpg" alt="">
27
+ </figure>
28
+
29
+
30
+ [Markdown]
31
+ Figure. A caption.
32
+
33
+ ![](cat.jpg)
34
+
35
+ [HTML]
36
+ <p class="f-img"><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</p>
37
+ <figure class="f-img">
38
+ <img src="cat.jpg" alt="">
39
+ </figure>
40
+
41
+
42
+ [Markdown]
43
+ ![Figure 12. A caption.](cat.jpg)
44
+
45
+ [HTML]
46
+ <figure class="f-img">
47
+ <figcaption><span class="f-img-label">Figure 12<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
48
+ <img src="cat.jpg" alt="">
49
+ </figure>
50
+
51
+
52
+ [Markdown]
53
+ ![図1 キャプション](cat.jpg)
54
+
55
+ [HTML]
56
+ <figure class="f-img">
57
+ <figcaption><span class="f-img-label">図1<span class="f-img-label-joint"> </span></span>キャプション</figcaption>
58
+ <img src="cat.jpg" alt="">
59
+ </figure>
60
+
61
+
62
+ [Markdown]
63
+ 図 キャプション
64
+
65
+ ![図1 キャプション](cat.jpg)
66
+
67
+ [HTML]
68
+ <p class="f-img"><span class="f-img-label">図</span> キャプション</p>
69
+ <figure class="f-img">
70
+ <figcaption><span class="f-img-label">図1<span class="f-img-label-joint"> </span></span>キャプション</figcaption>
71
+ <img src="cat.jpg" alt="">
72
+ </figure>
73
+
74
+
75
+ [Markdown]
76
+ ![A caption.](cat.jpg)
77
+
78
+ ![図 A caption.](cat.jpg)
79
+
80
+ [HTML]
81
+ <figure class="f-img">
82
+ <figcaption><span class="f-img-label">図<span class="f-img-label-joint"> </span></span>A caption.</figcaption>
83
+ <img src="cat.jpg" alt="">
84
+ </figure>
85
+ <figure class="f-img">
86
+ <figcaption><span class="f-img-label">図</span> A caption.</figcaption>
87
+ <img src="cat.jpg" alt="">
88
+ </figure>
89
+
@@ -0,0 +1,90 @@
1
+ [Markdown]
2
+ ![](cat.jpg "A caption.")
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
+ ![](cat.jpg "Figure. A caption.")
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
+ ![A alt text.](cat.jpg)
23
+
24
+ [HTML]
25
+ <figure class="f-img">
26
+ <img src="cat.jpg" alt="A alt text.">
27
+ </figure>
28
+
29
+ [Markdown]
30
+ ![A alt text.](cat.jpg "Figure.")
31
+
32
+ [HTML]
33
+ <figure class="f-img">
34
+ <figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span></figcaption>
35
+ <img src="cat.jpg" alt="A alt text.">
36
+ </figure>
37
+
38
+
39
+ [Markdown]
40
+ Figure. A caption.
41
+
42
+ ![](cat.jpg)
43
+
44
+ [HTML]
45
+ <p class="f-img"><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</p>
46
+ <figure class="f-img">
47
+ <img src="cat.jpg" alt="">
48
+ </figure>
49
+
50
+
51
+ [Markdown]
52
+ ![](cat.jpg "Figure 12. A caption.")
53
+
54
+ [HTML]
55
+ <figure class="f-img">
56
+ <figcaption><span class="f-img-label">Figure 12<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
57
+ <img src="cat.jpg" alt="">
58
+ </figure>
59
+
60
+
61
+ [Markdown]
62
+ ![猫](cat.jpg "図1 キャプション")
63
+
64
+ [HTML]
65
+ <figure class="f-img">
66
+ <figcaption><span class="f-img-label">図1<span class="f-img-label-joint"> </span></span>キャプション</figcaption>
67
+ <img src="cat.jpg" alt="猫">
68
+ </figure>
69
+
70
+ [Markdown]
71
+ ![](cat.jpg "図 キャプション")
72
+
73
+ [HTML]
74
+ <figure class="f-img">
75
+ <figcaption><span class="f-img-label">図</span> キャプション</figcaption>
76
+ <img src="cat.jpg" alt="">
77
+ </figure>
78
+
79
+
80
+ [Markdown]
81
+ 図 キャプション
82
+
83
+ ![猫](cat.jpg "図23 Caption")
84
+
85
+ [HTML]
86
+ <p class="f-img"><span class="f-img-label">図</span> キャプション</p>
87
+ <figure class="f-img">
88
+ <figcaption><span class="f-img-label">図23</span> Caption</figcaption>
89
+ <img src="cat.jpg" alt="猫">
90
+ </figure>