{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/Docusaurus/issues/1138","repository_url":"https://api.github.com/repos/facebook/Docusaurus","labels_url":"https://api.github.com/repos/facebook/Docusaurus/issues/1138/labels{/name}","comments_url":"https://api.github.com/repos/facebook/Docusaurus/issues/1138/comments","events_url":"https://api.github.com/repos/facebook/Docusaurus/issues/1138/events","html_url":"https://github.com/facebook/Docusaurus/pull/1138","id":386779855,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NDE3MTg2","number":1138,"title":"fix: support relative markdown linking","user":{"login":"endiliey","id":17883920,"node_id":"MDQ6VXNlcjE3ODgzOTIw","avatar_url":"https://avatars3.githubusercontent.com/u/17883920?v=4","gravatar_id":"","url":"https://api.github.com/users/endiliey","html_url":"https://github.com/endiliey","followers_url":"https://api.github.com/users/endiliey/followers","following_url":"https://api.github.com/users/endiliey/following{/other_user}","gists_url":"https://api.github.com/users/endiliey/gists{/gist_id}","starred_url":"https://api.github.com/users/endiliey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endiliey/subscriptions","organizations_url":"https://api.github.com/users/endiliey/orgs","repos_url":"https://api.github.com/users/endiliey/repos","events_url":"https://api.github.com/users/endiliey/events{/privacy}","received_events_url":"https://api.github.com/users/endiliey/received_events","type":"User","site_admin":false},"labels":[{"id":630651545,"node_id":"MDU6TGFiZWw2MzA2NTE1NDU=","url":"https://api.github.com/repos/facebook/Docusaurus/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-03T11:42:36Z","updated_at":"2018-12-03T20:59:58Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/facebook/Docusaurus/pulls/1138","html_url":"https://github.com/facebook/Docusaurus/pull/1138","diff_url":"https://github.com/facebook/Docusaurus/pull/1138.diff","patch_url":"https://github.com/facebook/Docusaurus/pull/1138.patch"},"body":"## Motivation\r\n\r\nFix #1137 \r\n\r\nUpon finding, we actually never really support relative markdown linking since initial release. Things has been working so far because lot of people refer to doc by doing `[test](dir1/test.md]`, however `[test](../test.md)` will not work because we never really properly resolve it when replacing the markdown linking\r\n\r\nThe key change here is this\r\n\r\n```js\r\nmdToHtml[resolve(metadata.source, mdMatch[1])];\r\n```\r\n\r\nOh another thing is we no longer replace markdown linking in fenced blocks 👍\r\n\r\n### Have you read the [Contributing Guidelines on pull requests](https://github.com/facebook/Docusaurus/blob/master/CONTRIBUTING.md#pull-requests)?\r\n\r\nYes\r\n\r\n## Test Plan\r\n\r\n1. Clone the Redux repo at https://github.com/reduxjs/redux\r\n2. Check out the `docs-rebuild` branch\r\n3. Copy this PR patched file at `Docusaurus/v1/lib/server/docs.js` to `redux/website/node_modules/Docusaurus/lib/server/docs.js`\r\n4. Start Docusaurus\r\n\r\nBefore\r\n\r\n![before](https://user-images.githubusercontent.com/17883920/49371783-92051700-f733-11e8-8d2a-efd1fdb18c59.gif)\r\n\r\n\r\nAfter\r\n\r\n![after](https://user-images.githubusercontent.com/17883920/49371477-8533f380-f732-11e8-99fd-06673f448564.gif)\r\n\r\n\r\ncc @markerikson\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/Docusaurus/issues/comments/443868203","html_url":"https://github.com/facebook/Docusaurus/pull/1138#issuecomment-443868203","issue_url":"https://api.github.com/repos/facebook/Docusaurus/issues/1138","id":443868203,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mzg2ODIwMw==","user":{"login":"tibdex","id":6574550,"node_id":"MDQ6VXNlcjY1NzQ1NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6574550?v=4","gravatar_id":"","url":"https://api.github.com/users/tibdex","html_url":"https://github.com/tibdex","followers_url":"https://api.github.com/users/tibdex/followers","following_url":"https://api.github.com/users/tibdex/following{/other_user}","gists_url":"https://api.github.com/users/tibdex/gists{/gist_id}","starred_url":"https://api.github.com/users/tibdex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tibdex/subscriptions","organizations_url":"https://api.github.com/users/tibdex/orgs","repos_url":"https://api.github.com/users/tibdex/repos","events_url":"https://api.github.com/users/tibdex/events{/privacy}","received_events_url":"https://api.github.com/users/tibdex/received_events","type":"User","site_admin":false},"created_at":"2018-12-03T20:59:58Z","updated_at":"2018-12-03T20:59:58Z","author_association":"NONE","body":"Thanks for fixing this @endiliey! Would it be possible to also fix relative links for assets in this PR? \r\n\r\nA link like `![nice picture](../assets/picture.png)` would still not work with the current suggested changes.\r\n\r\nThe issue was already reported in #705 (see https://github.com/facebook/Docusaurus/pull/705#issuecomment-407353366).\r\n\r\nBasically, the goal is to be able to use the same link paths (for markdown documents and assets) both when browsing the source in GitHub (or the Markdown Preview in VS Code) and when building the docs with Docusaurus."}}
{"actor":{"display_login":"tibdex"}}