Skip to content

Commit

Permalink
fix(Footnote): Correct output of href/id attrs
Browse files Browse the repository at this point in the history
Previously we were outputting `#my-id` as the id attribute and `my-id`
as the href attribute for footnote references.
  • Loading branch information
knubie authored and HHogg committed Jun 1, 2020
1 parent 75848a4 commit eceabe2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/defaultRemarkableProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export default {
case 'footnote_anchor':
return {
key: 'href',
value: `fn${id}:${token.subId || 0}`,
value: `#fn${id}:${token.subId || 0}`,
};
case 'footnote_open':
return { value: `#fn${id}` };
return { value: `fn${id}` };
case 'footnote_ref':
return type === 'a' ? ({
key: 'href',
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/Renderer.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ Array [
<section>
<ol>
<li
id="#fn0"
id="fn0"
>
<p>
Foonote body
<a
href="fn0:0"
href="#fn0:0"
>
</a>
Expand Down
6 changes: 3 additions & 3 deletions test/__snapshots__/TokenTree.components.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Array [
Object {
"children": "",
"props": Object {
"href": "fn0:0",
"href": "#fn0:0",
},
"type": "a",
},
Expand All @@ -170,7 +170,7 @@ Array [
},
],
"props": Object {
"id": "#fn0",
"id": "fn0",
},
"type": "li",
},
Expand Down Expand Up @@ -239,7 +239,7 @@ Array [
},
],
"props": Object {
"id": "#fn0",
"id": "fn0",
},
"type": "li",
},
Expand Down

0 comments on commit eceabe2

Please sign in to comment.