-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build absolute links on block files #39
Conversation
@@ -15,8 +15,9 @@ var util = require('util'), | |||
DOC: /^\.?\/?(?:\.\.\/)+?([\w|-]+)\.?[md|html|ru\.md|en\.md]?/, | |||
VERSION_DOC: /^\.?\/?(\d+\.\d+\.\d+)\-([\w|-]+)?\.?[md|html|ru\.md|en\.md]?/, | |||
BLOCK: /^\.\.?\/([\w|-]+)\/?([\w|-]+)?\.?[md|html|ru\.md|en\.md]?/, | |||
BLOCKS: /^\.?\/?(?:\.\.\/)?([\w|-]+)\.blocks\/([\w|-]+)\/?([\w|-]+)?\.?[md|html|ru\.md|en\.md]?/, | |||
BLOCKS: /^\.?\/?(?:\.\.\/)?([\w|-]+)\.blocks\/([\w|-]+)\/?([\w|-]+)?\.[md|html|ru\.md|en\.md]/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот эта штуковина матчилась на всё подряд про блоки. В матч попадал common.blocks/popup/popup.js
, а не должен был
@@ -261,8 +268,10 @@ function overrideLinks(content, node, urlHash, lang, doc) { | |||
links.push(href.replace(/\/tree\//, '/blob/')); | |||
links.push(href.replace(/\/blob\//, '/tree/')); | |||
} else { | |||
links.push(buildFullGithubLinkForDocs(href, doc, 'tree', node)); | |||
links.push(buildFullGithubLinkForDocs(href, doc, 'blob', node)); | |||
if(href.match(REGEXP.RELATIVE.JSON) || doc && doc.repo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для того, что бы в массив не происходил пуш всего, что не попало в условия, которые написаны в методе buildFullGithubLinkForDocs
🆗 |
Build absolute links on block files
Может стоит подумать про написание тестов на конкретный таск с перечислением всех кейсов? |
No description provided.