Skip to content

Commit 5785668

Browse files
committed
Fixed anchro links in Markdown documentation
1 parent bb256ef commit 5785668

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

website/core/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var Header = React.createClass({
2020
<H {...this.props}>
2121
<a className="anchor" name={slug}></a>
2222
{this.props.children}
23-
{' '}<a className="hash-link" href={'#' + slug}>#</a>
23+
{' '}<a className="hash-link" href={this.props.path + '#' + slug}>#</a>
2424
</H>
2525
);
2626
}

website/core/Marked.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ Parser.prototype.tok = function() {
821821
return (
822822
<Header
823823
level={this.token.depth}
824+
path={this.options.path}
824825
toSlug={this.token.text}>
825826
{this.inline.output(this.token.text)}
826827
</Header>

website/layout/DocsLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var DocsLayout = React.createClass({
3030
level={1}
3131
path={'docs/' + metadata.filename}
3232
/>
33-
<Marked>{content}</Marked>
33+
<Marked path={metadata.permalink}>{content}</Marked>
3434
<div className="docs-prevnext">
3535
{metadata.previous && <a className="docs-prev" href={metadata.previous + '.html#content'}>&larr; Prev</a>}
3636
{metadata.next && <a className="docs-next" href={metadata.next + '.html#content'}>Next &rarr;</a>}

0 commit comments

Comments
 (0)