Skip to content

Fix feature label linking#400

Merged
Elchi3 merged 2 commits intomasterfrom
render-fix
Sep 25, 2017
Merged

Fix feature label linking#400
Elchi3 merged 2 commits intomasterfrom
render-fix

Conversation

@Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Sep 22, 2017

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object where __count__ etc. aren't linked, although they have an mdn_url.

(yes, we should write exhaustive tests for this code/macro – there are more bugs in here, for sure)

@Elchi3 Elchi3 added the bug Confirmed bugs in the repository (i.e. linter bugs), NOT browser implementation bugs. label Sep 22, 2017
@Elchi3 Elchi3 requested a review from wbamberg September 22, 2017 09:22
Copy link
Contributor

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

This looks fine. I made one improvement suggestion.

test/render.js Outdated
} else {
desc += `<code>${Object.keys(row)[0]}</code>`;
}
if (feature.mdn_url) { desc += '</a>'; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be a bit cleaner, instead of having this and line 365, to build desc without the link, then wrap it at the end:

if (feature.mdn_url) {
  desc = `<a href="${feature.mdn_url}">${desc}</a>`;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea!

@Elchi3 Elchi3 merged commit 6dd9dd8 into master Sep 25, 2017
@Elchi3 Elchi3 deleted the render-fix branch September 25, 2017 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Confirmed bugs in the repository (i.e. linter bugs), NOT browser implementation bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants