@peaceroad/markdown-it-figure-with-p-caption 0.7.0 → 0.8.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
@@ -114,7 +114,7 @@ A paragraph.
114
114
 
115
115
  [HTML]
116
116
  <p>A paragraph.</p>
117
- <figure class="f-pre-code" role="doc-example">
117
+ <figure class="f-pre-code">
118
118
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> A Caption.</figcaption>
119
119
  <pre><code class="language-js">console.log('Hello World!');
120
120
  </code></pre>
@@ -156,7 +156,7 @@ A paragraph.
156
156
 
157
157
  [HTML]
158
158
  <p>A paragraph.</p>
159
- <figure class="f-pre-samp" role="doc-example">
159
+ <figure class="f-pre-samp">
160
160
  <figcaption><span class="f-pre-samp-label">Terminal<span class="f-pre-samp-label-joint">.</span></span> A Caption.</figcaption>
161
161
  <pre><samp>$ pwd
162
162
  /home/user
@@ -329,7 +329,7 @@ A paragraph.
329
329
 
330
330
  [HTML]
331
331
  <p>A paragraph.</p>
332
- <figure class="f-pre-code" role="doc-example">
332
+ <figure class="f-pre-code">
333
333
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> <strong class="f-pre-code-filename">filename.js</strong> Call a cat.</figcaption>
334
334
  <pre><code class="language-js">console.log('Nyaan!');
335
335
  </code></pre>
@@ -358,7 +358,7 @@ A paragraph.
358
358
 
359
359
  [HTML]
360
360
  <p>A paragraph.</p>
361
- <figure class="f-pre-code" role="doc-example">
361
+ <figure class="f-pre-code">
362
362
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> <strong class="f-pre-code-filename">filename.js</strong> Call a cat.</figcaption>
363
363
  <pre><code class="language-js">console.log('Nyaan!');
364
364
  </code></pre>
@@ -464,7 +464,7 @@ A paragraph.
464
464
  </figure>
465
465
  ~~~
466
466
 
467
- ## Option: imgAltCaption
467
+ ### Option: imgAltCaption
468
468
 
469
469
  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.
470
470
  Note that you cannot use this plugin's syntax and this option's syntax at the same time.
@@ -486,7 +486,7 @@ const mdImgAltCaption = mdit({html: true}).use(mditFigureWithPCaption, {imgAltCa
486
486
  </figure>
487
487
  ```
488
488
 
489
- ## Option: imgTitleCaption
489
+ ### Option: imgTitleCaption
490
490
 
491
491
  The title attribute of the Markdown img element is used as the caption.
492
492
  Note that you cannot use this plugin's standard syntax and this option's syntax at the same time.
@@ -506,4 +506,12 @@ const mdImgAltCaption = mdit({html: true}).use(mditFigureWithPCaption, {imgTitle
506
506
  <figcaption><span class="f-img-label">Figure<span class="f-img-label-joint">.</span></span> A caption.</figcaption>
507
507
  <img src="cat.jpg" alt="A alt text.">
508
508
  </figure>
509
- ```
509
+ ```
510
+
511
+ ### Option: roleDocExample
512
+
513
+ From version 0.8, role="doc-example" is not included as standard in figure.f-pre-code and figure.f-pre-samp. If necessary, set `roleDocExample: true.`
514
+
515
+ ```js
516
+ const mdImgAltCaption = mdit({html: true}).use(mditFigureWithPCaption, {roleDocExample: true})
517
+ ```
package/index.js CHANGED
@@ -4,6 +4,7 @@ const mditFigureWithPCaption = (md, option) => {
4
4
 
5
5
  let opt = {
6
6
  classPrefix: 'f',
7
+ figureClassThatWrapsIframeTypeBlockquote: 'f-img',
7
8
  styleProcess : true,
8
9
  hasNumClass: false,
9
10
  scaleSuffix: false,
@@ -21,6 +22,7 @@ const mditFigureWithPCaption = (md, option) => {
21
22
  multipleImages: true,
22
23
  imgAltCaption: false,
23
24
  imgTitleCaption: false,
25
+ roleDocExample: false,
24
26
  };
25
27
  if (option !== undefined) {
26
28
  for (let o in option) {
@@ -147,13 +149,19 @@ const mditFigureWithPCaption = (md, option) => {
147
149
  figureStartToken.attrSet('class', 'f-video');
148
150
  }
149
151
  if (sp.isIframeTypeBlockQuote) {
150
- if (sp.hasImgCaption) {
151
- figureStartToken.attrSet('class', 'f-img');
152
+ let figureClassThatWrapsIframeTypeBlockquote = 'i-frame'
153
+ if (caption.prev || caption.next) {
154
+ if (caption.name === 'img') {
155
+ figureClassThatWrapsIframeTypeBlockquote = 'f-img'
156
+ }
157
+ figureStartToken.attrSet('class', figureClassThatWrapsIframeTypeBlockquote)
152
158
  } else {
153
- figureStartToken.attrSet('class', 'f-iframe');
159
+ console.log('else::')
160
+ figureClassThatWrapsIframeTypeBlockquote = opt.figureClassThatWrapsIframeTypeBlockquote
161
+ figureStartToken.attrSet('class', figureClassThatWrapsIframeTypeBlockquote)
154
162
  }
155
163
  }
156
- if(/pre-(?:code|samp)/.test(tagName)) {
164
+ if(/pre-(?:code|samp)/.test(tagName) && opt.roleDocExample) {
157
165
  figureStartToken.attrSet('role', 'doc-example');
158
166
  }
159
167
  const figureEndToken = new state.Token('figure_close', 'figure', -1);
@@ -252,7 +260,7 @@ const mditFigureWithPCaption = (md, option) => {
252
260
  if (token.tag === 'code' && token.block) {
253
261
  checkToken = true;
254
262
  let isSampInfo = false
255
- if (token.info === 'samp' || token.info === 'shell' || token.info === 'console') {
263
+ if (/^ *(?:samp|shell|console)(?:(?= )|$)/.test(token.info)) {
256
264
  token.tag = 'samp';
257
265
  isSampInfo = true
258
266
  }
@@ -276,12 +284,11 @@ const mditFigureWithPCaption = (md, option) => {
276
284
  const tags = ['video', 'audio', 'iframe', 'blockquote'];
277
285
  let ctj = 0;
278
286
  while (ctj < tags.length) {
279
- const hasTag = token.content.match(new RegExp('^<'+ tags[ctj] + ' ?[^>]*?>[\\s\\S]*?<\\/' + tags[ctj] + '>(\\n| *?)(<script [^>]*?>(?:<\\/script>)?)?(\\n|$)'));
287
+ const hasTag = token.content.match(new RegExp('^<'+ tags[ctj] + ' ?[^>]*?>[\\s\\S]*?<\\/' + tags[ctj] + '>(\\n| *?)(<script [^>]*?>(?:<\\/script>)?)? *(\\n|$)'));
280
288
  if (!hasTag) {
281
289
  ctj++;
282
290
  continue;
283
291
  }
284
- //console.log(hasTag)
285
292
  if ((hasTag[2] && hasTag[3] !== '\n') ||
286
293
  (hasTag[1] !== '\n' && hasTag[2] === undefined)) {
287
294
  token.content += '\n'
@@ -307,23 +314,27 @@ const mditFigureWithPCaption = (md, option) => {
307
314
  }
308
315
  if(sp.isIframeTypeBlockQuote) {
309
316
  if(n > 2) {
310
- if (state.tokens[n-2].children.length > 1) {
311
- if (state.tokens[n-2].children[1].attrs.length > 0) {
312
- if (state.tokens[n-2].children[1].attrs[0][0] === 'class') {
313
- if (state.tokens[n-2].children[1].attrs[0][1] === 'f-img-label') {
314
- sp.hasImgCaption = true;
315
- /* For now, I think I should use figure instead of blockquoe for caption. */
317
+ if (state.tokens[n-2].children) {
318
+ if (state.tokens[n-2].children.length > 1) {
319
+ if (state.tokens[n-2].children[1].attrs) {
320
+ if (state.tokens[n-2].children[1].attrs[0][0] === 'class') {
321
+ if (state.tokens[n-2].children[1].attrs[0][1] === 'f-img-label') {
322
+ sp.hasImgCaption = true;
323
+ /* For now, I think I should use figure instead of blockquoe for caption. */
324
+ }
316
325
  }
317
326
  }
318
327
  }
319
328
  }
320
329
  }
321
330
  if (n + 2 < state.tokens.length) {
322
- if (state.tokens[n+2].children.length > 1) {
323
- if (state.tokens[n+2].children[1].attrs.length > 0) {
324
- if (state.tokens[n+2].children[1].attrs[0][0] === 'class' &&
325
- state.tokens[n+2].children[1].attrs[0][1] === 'f-img-label') {
326
- sp.hasImgCaption = true;
331
+ if (state.tokens[n+2].children) {
332
+ if (state.tokens[n+2].children.length > 1) {
333
+ if (state.tokens[n+2].children[1].attrs) {
334
+ if (state.tokens[n+2].children[1].attrs[0][0] === 'class' &&
335
+ state.tokens[n+2].children[1].attrs[0][1] === 'f-img-label') {
336
+ sp.hasImgCaption = true;
337
+ }
327
338
  }
328
339
  }
329
340
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peaceroad/markdown-it-figure-with-p-caption",
3
- "version": "0.7.0",
3
+ "version": "0.8.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
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "url": "https://github.com/peaceroad/p7d-markdown-it-figure-with-p-caption/issues"
15
15
  },
16
16
  "devDependencies": {
17
- "@peaceroad/markdown-it-renderer-fence": "^0.1.0",
17
+ "@peaceroad/markdown-it-renderer-fence": "^0.1.1",
18
18
  "highlight.js": "^11.9.0",
19
19
  "markdown-it": "^14.1.0",
20
20
  "markdown-it-attrs": "^4.1.6"
@@ -92,3 +92,34 @@ $ pwd
92
92
  /home/User
93
93
  </samp></pre>
94
94
 
95
+
96
+ [Markdown]
97
+ 端末 現在のディレクトリ
98
+
99
+ ```samp {.style}
100
+ $ pwd
101
+ /home/User
102
+ ```
103
+ [HTML]
104
+ <figure class="f-pre-samp">
105
+ <figcaption><span class="f-pre-samp-label">端末</span> 現在のディレクトリ</figcaption>
106
+ <pre><samp class="style">$ pwd
107
+ /home/User
108
+ </samp></pre>
109
+ </figure>
110
+
111
+
112
+ [Markdown]
113
+ 端末 現在のディレクトリ
114
+
115
+ ```console {.style}
116
+ $ pwd
117
+ /home/User
118
+ ```
119
+ [HTML]
120
+ <figure class="f-pre-samp">
121
+ <figcaption><span class="f-pre-samp-label">端末</span> 現在のディレクトリ</figcaption>
122
+ <pre><samp class="language-console style"><span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">pwd</span></span>
123
+ /home/User
124
+ </samp></pre>
125
+ </figure>
@@ -23,7 +23,7 @@ A paragraph.
23
23
 
24
24
  [HTML]
25
25
  <p>A paragraph.</p>
26
- <figure class="f-pre-code" role="doc-example">
26
+ <figure class="f-pre-code">
27
27
  <figcaption><span class="f-pre-code-label label-has-num">リスト1</span> キャプション</figcaption>
28
28
  <pre><code class="language-js">console.log('Nyaan!');
29
29
  </code></pre>
@@ -6,7 +6,7 @@ A paragraph. iframeTypeBlockquoteWithoutCaption: true.
6
6
  A paragraph.
7
7
  [HTML]
8
8
  <p>A paragraph. iframeTypeBlockquoteWithoutCaption: true.</p>
9
- <figure class="f-iframe">
9
+ <figure class="f-img">
10
10
  <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>
11
11
  </figure>
12
12
  <p>A paragraph.</p>
@@ -15,12 +15,40 @@ A paragraph.
15
15
  [Markdown]
16
16
  <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>
17
17
  [HTML]
18
- <figure class="f-iframe">
18
+ <figure class="f-img">
19
+ <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>
20
+ </figure>
21
+
22
+
23
+ [Markdown]
24
+ <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>
25
+
26
+ <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>
27
+ [HTML]
28
+ <figure class="f-img">
29
+ <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>
30
+ </figure>
31
+ <figure class="f-img">
19
32
  <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>
20
33
  </figure>
21
34
 
22
35
 
23
36
 
37
+ [Markdown]
38
+ <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>
39
+
40
+ <!-- -->
41
+
42
+ <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>
43
+ [HTML]
44
+ <figure class="f-img">
45
+ <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>
46
+ </figure>
47
+ <!-- -->
48
+ <figure class="f-img">
49
+ <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>
50
+ </figure>
51
+
24
52
  [Markdown]
25
53
  <iframe src="https://mstdn.social/User/xxxxxxxx/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><script src="https://mstdn.social/embed.js" async="async"></script>
26
54
  [HTML]
@@ -34,7 +62,7 @@ A paragraph.
34
62
  <script async src="https://www.threads.net/embed.js"></script>
35
63
 
36
64
  [HTML]
37
- <figure class="f-iframe">
65
+ <figure class="f-img">
38
66
  <blockquote class="text-post-media" data-text-post-permalink="https://www.threads.net/User/post/xxxxxxxxxx" data-text-post-version="0" id="xxxxxx" style=" background:#FFF; border-width: 1px; border-style: solid; border-color: #00000026; border-radius: 16px; max-width:540px; margin: 1px; min-width:270px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"> <a href="https://www.threads.net/User/post/xxxxxxxxxxxxx" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" target="_blank"> <div style=" padding: 40px; display: flex; flex-direction: column; align-items: center;"><div style=" display:block; height:32px; width:32px; padding-bottom:20px;"> <svg aria-label="Threads" height="32px" role="img" viewBox="0 0 192 192" width="32px" xmlns="http://www.w3.org/2000/svg"> <path /></svg></div> <div style=" font-size: 15px; line-height: 21px; color: #999999; font-weight: 400; padding-bottom: 4px; "> 投稿者: xxxxx</div> <div style=" font-size: 15px; line-height: 21px; color: #000000; font-weight: 600; "> Threadsで見る</div></div></a></blockquote>
39
67
  <script async src="https://www.threads.net/embed.js"></script>
40
68
  </figure>
@@ -46,7 +74,7 @@ A paragraph.
46
74
 
47
75
 
48
76
  [HTML]
49
- <figure class="f-iframe">
77
+ <figure class="f-img">
50
78
  <blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/xxxxxxxxxxxxxxxxxxx" data-instgrm-version="14" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/p/xxxxxxxxxxxxxxxxxxxxxxx" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g><g><path></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;">この投稿をInstagramで見る</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="https://www.instagram.com/p/xxxxxxxxxxxxxx" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">Ueserがシェアした投稿</a></p></div></blockquote>
51
79
  <script async src="//www.instagram.com/embed.js"></script>
52
80
  </figure>
@@ -56,7 +84,7 @@ A paragraph.
56
84
  <blockquote class="bluesky-embed" data-bluesky-uri="at://did:plc:xxxxxxxxxz/app.bsky.feed.post/xxxxxxxxxxxxxxxxxx" data-bluesky-cid="xxxxxxxxxxxxxxxxxxxxxxxxxx"><p lang="ja">.....<br><br><a href="https://bsky.app/profile/did:plc:xxxxxxxxxxx/post/xxxxxxxxxxxxxx?ref_src=embed">[image or embed]</a></p>&mdash; user (<a href="https://bsky.app/profile/did:plc:xxxxxxxxxx?ref_src=embed">user</a>) <a href="https://bsky.app/profile/did:plc:xxxxxxxxxxxx/post/xxxxxxxxxxxx?ref_src=embed">Jun 7, 2024 at 9:49</a></blockquote><script async src="https://embed.bsky.app/static/embed.js" charset="utf-8"></script>
57
85
 
58
86
  [HTML]
59
- <figure class="f-iframe">
87
+ <figure class="f-img">
60
88
  <blockquote class="bluesky-embed" data-bluesky-uri="at://did:plc:xxxxxxxxxz/app.bsky.feed.post/xxxxxxxxxxxxxxxxxx" data-bluesky-cid="xxxxxxxxxxxxxxxxxxxxxxxxxx"><p lang="ja">.....<br><br><a href="https://bsky.app/profile/did:plc:xxxxxxxxxxx/post/xxxxxxxxxxxxxx?ref_src=embed">[image or embed]</a></p>&mdash; user (<a href="https://bsky.app/profile/did:plc:xxxxxxxxxx?ref_src=embed">user</a>) <a href="https://bsky.app/profile/did:plc:xxxxxxxxxxxx/post/xxxxxxxxxxxx?ref_src=embed">Jun 7, 2024 at 9:49</a></blockquote><script async src="https://embed.bsky.app/static/embed.js" charset="utf-8"></script>
61
89
  </figure>
62
90
 
@@ -62,4 +62,3 @@ Slide. A caption.
62
62
  <figure class="f-video">
63
63
  <iframe src="https://player.vimeo.com/video/xxxxxxxxxxxxxxx" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>
64
64
  </figure>
65
-
@@ -186,7 +186,7 @@ A paragraph.
186
186
 
187
187
  [HTML]
188
188
  <p>A paragraph.</p>
189
- <figure class="f-pre-code" role="doc-example">
189
+ <figure class="f-pre-code">
190
190
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> A Caption.</figcaption>
191
191
  <pre><code class="language-js">console.log('Hello World!');
192
192
  </code></pre>
@@ -207,7 +207,7 @@ A paragraph.
207
207
 
208
208
  [HTML]
209
209
  <p>A paragraph.</p>
210
- <figure class="f-pre-code" role="doc-example">
210
+ <figure class="f-pre-code">
211
211
  <pre><code class="language-js">console.log('Hello World!');
212
212
  </code></pre>
213
213
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> A Caption.</figcaption>
@@ -228,7 +228,7 @@ A paragraph.
228
228
 
229
229
  [HTML]
230
230
  <p>A paragraph.</p>
231
- <figure class="f-pre-samp" role="doc-example">
231
+ <figure class="f-pre-samp">
232
232
  <figcaption><span class="f-pre-samp-label">Terminal<span class="f-pre-samp-label-joint">.</span></span> A Caption.</figcaption>
233
233
  <pre><samp>$ pwd
234
234
  /home/user
@@ -250,7 +250,7 @@ Terminal. A Caption.
250
250
  A paragraph.
251
251
  [HTML]
252
252
  <p>A paragraph.</p>
253
- <figure class="f-pre-samp" role="doc-example">
253
+ <figure class="f-pre-samp">
254
254
  <pre><samp>$ pwd
255
255
  /home/user
256
256
  </samp></pre>
@@ -452,7 +452,7 @@ Source. Twitter Post.
452
452
  A paragraph.
453
453
  [HTML]
454
454
  <p>A paragraph.</p>
455
- <figure class="f-iframe">
455
+ <figure class="f-img">
456
456
  <figcaption><span class="f-blockquote-label">Source<span class="f-blockquote-label-joint">.</span></span> Twitter Post.</figcaption>
457
457
  <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>
458
458
  </figure>
@@ -500,7 +500,7 @@ Quote. Twitter Post.
500
500
  A paragraph.
501
501
  [HTML]
502
502
  <p>A paragraph.</p>
503
- <figure class="f-iframe">
503
+ <figure class="f-img">
504
504
  <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>
505
505
  <figcaption><span class="f-blockquote-label">Quote<span class="f-blockquote-label-joint">.</span></span> Twitter Post.</figcaption>
506
506
  </figure>
@@ -533,7 +533,7 @@ A paragraph.
533
533
 
534
534
  [HTML]
535
535
  <p>A paragraph.</p>
536
- <figure class="f-pre-code" role="doc-example">
536
+ <figure class="f-pre-code">
537
537
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> <strong class="f-pre-code-filename">filename.js</strong> Call a cat.</figcaption>
538
538
  <pre><code class="language-js">console.log('Nyaan!');
539
539
  </code></pre>
@@ -553,7 +553,7 @@ A paragraph.
553
553
 
554
554
  [HTML]
555
555
  <p>A paragraph.</p>
556
- <figure class="f-pre-code" role="doc-example">
556
+ <figure class="f-pre-code">
557
557
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> <strong class="f-pre-code-filename">filename.js</strong> Call a cat.</figcaption>
558
558
  <pre><code class="language-js">console.log('Nyaan!');
559
559
  </code></pre>
@@ -573,7 +573,7 @@ A paragraph.
573
573
 
574
574
  [HTML]
575
575
  <p>A paragraph.</p>
576
- <figure class="f-pre-code" role="doc-example">
576
+ <figure class="f-pre-code">
577
577
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> <strong class="f-pre-code-filename">filename.js</strong></figcaption>
578
578
  <pre><code class="language-js">console.log('Nyaan!');
579
579
  </code></pre>
@@ -593,7 +593,7 @@ A paragraph.
593
593
 
594
594
  [HTML]
595
595
  <p>A paragraph.</p>
596
- <figure class="f-pre-code" role="doc-example">
596
+ <figure class="f-pre-code">
597
597
  <figcaption><span class="f-pre-code-label">Code<span class="f-pre-code-label-joint">.</span></span> <strong class="f-pre-code-filename">filename.js</strong></figcaption>
598
598
  <pre><code class="language-js">console.log('Nyaan!');
599
599
  </code></pre>
@@ -662,3 +662,13 @@ Slide. A caption.
662
662
  </video>
663
663
 
664
664
 
665
+ [Markdown]
666
+ 図 キャプション
667
+
668
+ <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>
669
+ [HTML]
670
+ <figure class="f-img">
671
+ <figcaption><span class="f-img-label">図</span> キャプション</figcaption>
672
+ <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>
673
+ </figure>
674
+
@@ -9,3 +9,44 @@
9
9
  </video>
10
10
  </figure>
11
11
 
12
+ [Markdown]
13
+ Video. A caption.
14
+
15
+ <video controls width="400" height="300">
16
+ <source src="example.mp4" type="video/mp4">
17
+ </video>
18
+ [HTML]
19
+ <figure class="f-video">
20
+ <figcaption><span class="f-video-label">Video<span class="f-video-label-joint">.</span></span> A caption.</figcaption>
21
+ <video controls width="400" height="300">
22
+ <source src="example.mp4" type="video/mp4">
23
+ </video>
24
+ </figure>
25
+
26
+
27
+ [Markdown]
28
+ A YouTube paragraph.
29
+
30
+ <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>
31
+
32
+ A paragraph.
33
+ [HTML]
34
+ <p>A YouTube paragraph.</p>
35
+ <figure class="f-video">
36
+ <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>
37
+ </figure>
38
+ <p>A paragraph.</p>
39
+
40
+
41
+ [Markdown]
42
+ Video. A YouTube caption.
43
+
44
+ <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>
45
+
46
+ A paragraph.
47
+ [HTML]
48
+ <figure class="f-video">
49
+ <figcaption><span class="f-video-label">Video<span class="f-video-label-joint">.</span></span> A YouTube caption.</figcaption>
50
+ <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>
51
+ </figure>
52
+ <p>A paragraph.</p>