Skip to content

Commit

Permalink
Update docs, tests for changes in remark-rehype
Browse files Browse the repository at this point in the history
Closes GH-6.
  • Loading branch information
wooorm committed Aug 22, 2021
1 parent bc2768f commit cf5b45e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"remark-cli": "^10.0.0",
"remark-parse": "^10.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-rehype": "^8.0.0",
"remark-rehype": "^9.0.0",
"remark-stringify": "^10.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
Expand All @@ -58,7 +58,7 @@
"typescript": "^4.0.0",
"unist-builder": "^3.0.0",
"unist-util-remove-position": "^4.0.0",
"xo": "^0.43.0"
"xo": "^0.44.0"
},
"scripts": {
"build": "rimraf \"test/**/*.d.ts\" \"*.d.ts\" && tsc && type-coverage",
Expand Down
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ Now, running `node example` yields:

```html
<p>
Here is a footnote reference,<sup id="fnref-1"><a href="#fn-1" class="footnote-ref">1</a></sup>
another,<sup id="fnref-longnote"><a href="#fn-longnote" class="footnote-ref">longnote</a></sup>,
Here is a footnote reference,<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>
another,<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>,
and optionally there are inline
notes.<sup id="fnref-2"><a href="#fn-2" class="footnote-ref">2</a></sup>
notes.<a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"><sup>3</sup></a>
</p>
<p>
This paragraph won’t be part of the note, because it
isn’t indented.
</p>
<div class="footnotes">
<section class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn-1">
<p>Here is the footnote.<a href="#fnref-1" class="footnote-backref">↩</a></p>
<li id="fn1" role="doc-endnote">
<p>Here is the footnote.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩</a></p>
</li>
<li id="fn-longnote">
<li id="fn2" role="doc-endnote">
<p>Here’s one with multiple blocks.</p>
<p>
Subsequent paragraphs are indented to show that they
Expand All @@ -112,17 +112,17 @@ Now, running `node example` yields:
<p>
The whole paragraph can be indented, or just the first
line. In this way, multi-paragraph footnotes work like
multi-paragraph list items.<a href="#fnref-longnote" class="footnote-backref">↩</a>
multi-paragraph list items.<a href="#fnref2" class="footnote-back" role="doc-backlink">↩</a>
</p>
</li>
<li id="fn-2">
<li id="fn3" role="doc-endnote">
<p>
you can type them inline, which may be easier, since you don’t
have to pick an identifier and move down to type the note.<a href="#fnref-2" class="footnote-backref">↩</a>
have to pick an identifier and move down to type the note.<a href="#fnref3" class="footnote-back" role="doc-backlink">↩</a>
</p>
</li>
</ol>
</div>
</section>
```

## API
Expand Down
26 changes: 13 additions & 13 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,27 +421,27 @@ test('html', (t) => {
.processSync(readSync({dirname: base, basename: 'footnotes-pandoc.md'}))
.toString(),
[
'<p>Here is a footnote reference,<sup id="fnref-1"><a href="#fn-1" class="footnote-ref">1</a></sup> and another.<sup id="fnref-longnote"><a href="#fn-longnote" class="footnote-ref">longnote</a></sup></p>',
'<p>Here is a footnote reference,<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a> and another.<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a></p>',
'<p>This paragraph won’t be part of the note, because it',
'isn’t indented.</p>',
'<div class="footnotes">',
'<section class="footnotes" role="doc-endnotes">',
'<hr>',
'<ol>',
'<li id="fn-1">',
'<p>Here is the footnote.<a href="#fnref-1" class="footnote-backref">↩</a></p>',
'<li id="fn1" role="doc-endnote">',
'<p>Here is the footnote.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩</a></p>',
'</li>',
'<li id="fn-longnote">',
'<li id="fn2" role="doc-endnote">',
'<p>Here’s one with multiple blocks.</p>',
'<p>Subsequent paragraphs are indented to show that they',
'belong to the previous footnote.</p>',
'<pre><code>{ some.code }',
'</code></pre>',
'<p>The whole paragraph can be indented, or just the first',
'line. In this way, multi-paragraph footnotes work like',
'multi-paragraph list items.<a href="#fnref-longnote" class="footnote-backref">↩</a></p>',
'multi-paragraph list items.<a href="#fnref2" class="footnote-back" role="doc-backlink">↩</a></p>',
'</li>',
'</ol>',
'</div>'
'</section>'
].join('\n'),
'should serialize footnote references and definitions to HTML'
)
Expand All @@ -453,17 +453,17 @@ test('html', (t) => {
)
.toString(),
[
'<p>Here is an inline note.<sup id="fnref-1"><a href="#fn-1" class="footnote-ref">1</a></sup></p>',
'<div class="footnotes">',
'<p>Here is an inline note.<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a></p>',
'<section class="footnotes" role="doc-endnotes">',
'<hr>',
'<ol>',
'<li id="fn-1">Inlines notes are easier to write, since',
'<li id="fn1" role="doc-endnote">Inlines notes are easier to write, since',
'you don’t have to pick an identifier and move down to type the',
'note.<a href="#fnref-1" class="footnote-backref">↩</a></li>',
'note.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩</a></li>',
'</ol>',
'</div>'
'</section>'
].join('\n'),
'should serialize footnote references and definitions to HTML'
'should serialize inline notes to HTML'
)

t.end()
Expand Down

0 comments on commit cf5b45e

Please sign in to comment.