@peaceroad/markdown-it-figure-with-p-caption 0.4.0 → 0.4.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
@@ -284,4 +284,4 @@ A paragraph.
284
284
  <img src="cat.jpg" alt="Figure">
285
285
  </figure>
286
286
  <p>A paragraph.</p>
287
- ~~~
287
+ ~~~
package/index.js CHANGED
@@ -6,6 +6,7 @@ module.exports = function figure_with_caption_plugin(md, option) {
6
6
 
7
7
  let opt = {
8
8
  classPrefix: 'f',
9
+ hasNumClass: false,
9
10
  scaleSuffix: false,
10
11
  dquoteFilename: false,
11
12
  strongFilename: false,
@@ -278,6 +279,7 @@ module.exports = function figure_with_caption_plugin(md, option) {
278
279
  classPrefix: opt.classPrefix,
279
280
  dquoteFilename: opt.dquoteFilename,
280
281
  strongFilename: opt.strongFilename,
282
+ hasNumClass: opt.hasNumClass,
281
283
  });
282
284
  md.core.ruler.before('linkify', 'figure_with_caption', figureWithCaption);
283
285
  md.renderer.rules['fence_samp'] = function (tokens, idx, options, env, slf) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peaceroad/markdown-it-figure-with-p-caption",
3
- "version": "0.4.0",
3
+ "version": "0.4.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
  "scripts": {
@@ -16,6 +16,6 @@
16
16
  "markdown-it": "^12.1.0"
17
17
  },
18
18
  "dependencies": {
19
- "p7d-markdown-it-p-captions": "^0.6.3"
19
+ "p7d-markdown-it-p-captions": "^0.7.0"
20
20
  }
21
21
  }
package/test/examples.txt CHANGED
@@ -285,7 +285,7 @@ Figure 12. A cat.
285
285
 
286
286
  [HTML]
287
287
  <figure class="f-img">
288
- <figcaption><span class="f-img-label">Figure 12<span class="f-img-label-joint">.</span></span> A cat.</figcaption>
288
+ <figcaption><span class="f-img-label label-has-num">Figure 12<span class="f-img-label-joint">.</span></span> A cat.</figcaption>
289
289
  <img src="cat.jpg" alt="Figure">
290
290
  </figure>
291
291
 
@@ -506,4 +506,26 @@ A paragraph.
506
506
  <figure class="f-img">
507
507
  <img src="cat.jpg" alt="Figure">
508
508
  </figure>
509
- <p>A paragraph.</p>
509
+ <p>A paragraph.</p>
510
+
511
+
512
+ [Markdown]
513
+ A paragraph.
514
+
515
+ リスト1 キャプション
516
+
517
+ ```js
518
+ console.log('Nyaan!');
519
+ ```
520
+
521
+ A paragraph.
522
+
523
+ [HTML]
524
+ <p>A paragraph.</p>
525
+ <figure class="f-pre-code" role="doc-example">
526
+ <figcaption><span class="f-pre-code-label label-has-num">リスト1</span> キャプション</figcaption>
527
+ <pre><code class="language-js">console.log('Nyaan!');
528
+ </code></pre>
529
+ </figure>
530
+ <p>A paragraph.</p>
531
+
package/test/test.js CHANGED
@@ -10,6 +10,7 @@ md.use(mdFigureWithPCaption, {
10
10
  dquoteFilename: true,
11
11
  strongFilename: true,
12
12
  oneImageWithoutCaption: true,
13
+ hasNumClass: true,
13
14
  });
14
15
 
15
16