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

Add tests for definition extraction #339

Merged
merged 3 commits into from
Jun 27, 2020
Merged

Add tests for definition extraction #339

merged 3 commits into from
Jun 27, 2020

Conversation

dontcallmedom
Copy link
Member

to help with extending it to HTML (#333), SVG (#334) and refining the rules (#336)

to help with extending it to HTML (#333), SVG (#334) and refining the rules (#336)
Copy link
Member

@tidoust tidoust left a comment

Choose a reason for hiding this comment

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

Looks good. Optional editorial comments inline

html: "<dfn id='foo'>Foo</dfn>",
dfns: [{}]
},
{title: "normalize whitespace and trims text in a simple <dfn>",
Copy link
Member

Choose a reason for hiding this comment

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

s/normalize/normalizes

const tests = [
{title: "parses a simple <dfn>",
html: "<dfn id='foo'>Foo</dfn>",
dfns: [{}]
Copy link
Member

Choose a reason for hiding this comment

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

I thought I'd note that I had some initial difficulty reading this because, without looking at the rest of the code, this suggests that the extraction will produce one empty object. That is, it would be easier to grasp immediately if here and below, this were [baseDfn] (or [Object.assign({}, baseDfn)]). I realize that means duplicating code, but then code is written once, read many times...

@tidoust tidoust merged commit 9e95e35 into master Jun 27, 2020
@tidoust tidoust deleted the test-extract-dfns branch August 27, 2020 08:45
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.

2 participants