Skip to content

Commit

Permalink
fix(core/link-to-dfn): URL encode fragments (closes #1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored and Marcos Cáceres committed Jul 20, 2017
1 parent d170cb4 commit 135b877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/link-to-dfn.js
Expand Up @@ -57,7 +57,8 @@ export function run(conf, doc, cb) {
if (dfn[0].dataset.cite) {
$ant[0].dataset.cite = dfn[0].dataset.cite;
} else {
$ant.attr("href", "#" + dfn.prop("id")).addClass("internalDFN");
const frag = "#" + encodeURIComponent(dfn.prop("id"));
$ant.attr("href", frag).addClass("internalDFN");
}
// add a bikeshed style indication of the type of link
if (!$ant.attr("data-link-type")) {
Expand Down

0 comments on commit 135b877

Please sign in to comment.