Skip to content
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

Merged
merged 1 commit into from
Jul 15, 2015
Merged

Build absolute links on block files #39

merged 1 commit into from
Jul 15, 2015

Conversation

gela-d
Copy link

@gela-d gela-d commented Jul 14, 2015

No description provided.

@@ -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]/,
Copy link
Author

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, а не должен был

@gela-d
Copy link
Author

gela-d commented Jul 14, 2015

@tormozz48

@@ -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) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для того, что бы в массив не происходил пуш всего, что не попало в условия, которые написаны в методе buildFullGithubLinkForDocs

@tormozz48
Copy link
Member

🆗

gela-d pushed a commit that referenced this pull request Jul 15, 2015
Build absolute links on block files
@gela-d gela-d merged commit 6813092 into master Jul 15, 2015
@gela-d gela-d deleted the BEMINFO-1354 branch July 15, 2015 08:07
@tavriaforever
Copy link
Member

Может стоит подумать про написание тестов на конкретный таск с перечислением всех кейсов?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants