Skip to content

Commit a17feb1

Browse files
committed
add slash at beginning
1 parent 3d357e9 commit a17feb1

File tree

5 files changed

+32
-27
lines changed

5 files changed

+32
-27
lines changed

docs/CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team by submitting a PR with changes to the [AUTHORS](#AUTHORS.md) page (or emailing [email protected]). All
58+
reported by contacting the project team by submitting a PR with changes to the [AUTHORS](#/AUTHORS.md) page (or emailing [email protected]). All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

docs/CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ The following table lists the ticket type labels we use when there is work to be
2525
|Ticket type label |Description |
2626
|:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2727
|L0 - security |A security vulnerability within the Marked library is discovered. |
28-
|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. |
28+
|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#/README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. |
2929
|L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. |
3030
|RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. |
31-
|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#README.md#specifications) |
31+
|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#/README.md#specifications) |
3232
|NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. |
3333

3434
## Test early, often, and everything
3535

36-
We try to write test cases to validate output (writing tests based on the [supported specifications](#README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness.
36+
We try to write test cases to validate output (writing tests based on the [supported specifications](#/README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness.
3737

3838
|Location |Description |
3939
|:-------------|:---------------------------------------------------|
@@ -92,4 +92,4 @@ npm run build
9292

9393
## Publishing
9494

95-
Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](#PUBLISHING.md).
95+
Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](#/PUBLISHING.md).

docs/PUBLISHING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Releasing Marked
22

3-
- [ ] See [contributing](#CONTRIBUTING.md)
3+
- [ ] See [contributing](#/CONTRIBUTING.md)
44
- [ ] Create release branch from `master` (`release-x.y.z`)
55
- [ ] Submit PR with minimal name: Release x.y.z
66
- [ ] Complete PR checklists

docs/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ $ cat hello.html
7070
```
7171

7272

73-
Marked offers [advanced configurations](#USING_ADVANCED.md) and [extensibility](#USING_PRO.md) as well.
73+
Marked offers [advanced configurations](#/USING_ADVANCED.md) and [extensibility](#/USING_PRO.md) as well.
7474

7575
<h2 id="specifications">Supported Markdown specifications</h2>
7676

@@ -88,17 +88,17 @@ By supporting the above Markdown flavors, it's possible that Marked can help you
8888

8989
The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously.
9090

91-
Therefore, please disclose potential security issues by email to the project [committers](#AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue).
91+
Therefore, please disclose potential security issues by email to the project [committers](#/AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue).
9292

9393
<h2 id="contributing">Contributing</h2>
9494

95-
The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](#CONTRIBUTING.md) for more details.
95+
The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](#/CONTRIBUTING.md) for more details.
9696

9797
For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md).
9898

9999
<h2 id="authors">Authors</h2>
100100

101-
For list of credited authors and contributors, please see our [authors page](#AUTHORS.md).
101+
For list of credited authors and contributors, please see our [authors page](#/AUTHORS.md).
102102

103103
<h2 id="license">License</h2>
104104

docs/index.html

+22-17
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<body>
7474
<div id="container">
7575
<header>
76-
<a href="#">
76+
<a href="#/README.md">
7777
<img src="img/logo-black.svg" height="64px" width="64px" />
7878
</a>
7979
<h1>Marked.js Documentation</h1>
@@ -110,8 +110,8 @@ <h1>Marked.js Documentation</h1>
110110

111111
var uri = hash.split('#');
112112

113-
if (uri[0].match('.md$')) {
114-
currentPage = uri[0];
113+
if (uri[0].match(/^\//)) {
114+
currentPage = uri[0].slice(1);
115115
if (uri.length > 1) {
116116
currentHash = uri[1];
117117
} else {
@@ -121,23 +121,23 @@ <h1>Marked.js Documentation</h1>
121121
currentHash = uri[0];
122122
}
123123

124-
fetchPage(currentPage)
125-
.then(function () {
126-
if(currentHash) {
127-
var hashElement = document.getElementById(currentHash);
128-
if (hashElement) {
129-
hashElement.scrollIntoView();
130-
}
131-
}
132-
});
124+
fetchPage(currentPage).then(function () {
125+
fetchAnchor(currentHash)
126+
});
133127

134-
history.replaceState('', document.title, '#' + currentPage + (currentHash ? '#' + currentHash : ''));
128+
history.replaceState('', document.title, '#/' + currentPage + (currentHash ? '#' + currentHash : ''));
135129
}
136130

137-
window.addEventListener('hashchange', function (e) {
138-
e.preventDefault();
139-
hashChange();
140-
});
131+
function fetchAnchor(anchor) {
132+
if (!anchor) {
133+
return;
134+
}
135+
136+
var hashElement = document.getElementById(anchor);
137+
if (hashElement) {
138+
hashElement.scrollIntoView();
139+
}
140+
}
141141

142142
function fetchPage(page) {
143143
if (page === renderedPage) {
@@ -160,6 +160,11 @@ <h1>Marked.js Documentation</h1>
160160
});
161161
}
162162

163+
window.addEventListener('hashchange', function (e) {
164+
e.preventDefault();
165+
hashChange();
166+
});
167+
163168
hashChange();
164169
</script>
165170
</body>

0 commit comments

Comments
 (0)