-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Update html-to-text version 8.1.0 #58922
Conversation
@ekremkenter Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 31 days — it is considered abandoned, and therefore closed! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 58922,
"author": "ekremkenter",
"headCommitOid": "99238bb7fb968d8b55d7836d47be11f912128c78",
"mergeBaseOid": "2faabb0aaad6ccc91b3f3546d7520e324c0f7ea2",
"lastPushDate": "2022-02-24T07:12:46.000Z",
"lastActivityDate": "2022-04-07T20:46:55.000Z",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "html-to-text",
"kind": "edit",
"files": [
{
"path": "types/html-to-text/html-to-text-tests.ts",
"kind": "test"
},
{
"path": "types/html-to-text/index.d.ts",
"kind": "definition"
}
],
"owners": [
"erykwarren",
"CarsonF",
"webstech"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
}
],
"reviews": [
{
"type": "changereq",
"reviewer": "webstech",
"date": "2022-03-10T19:01:03.000Z"
}
],
"mainBotCommentID": 1048663666,
"ciResult": "pass"
} |
🔔 @erykwarren @CarsonF @webstech — please review this PR in the next few days. Be sure to explicitly select |
@@ -51,17 +45,18 @@ const htmlOptions: HtmlToTextOptions = { | |||
a: { | |||
options: { | |||
hideLinkHrefIfSameAsText: true, | |||
linkBrackets: ['[', ']'], |
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.
Please add a test for false.
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.
Added, but couldn't run the tests. Could you explain how am I running those?
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.
Added, but couldn't run the tests. Could you explain how am I running those?
Did you follow these instructions?
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.
Yeah, I did. Tests just do linting, doesn't actually run the package, right?
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.
Looks like I copied the dir to a dummy 'project' with this in the package.json:
"scripts": {
"build": "tsc",
"test": "npm run build && node dist/html-to-text-tests.js -"
},
"dependencies": {
"html-to-text": "*"
}
Added "outDir": "./dist",
to the tsconfig.json
to keep things clean.
Ran npm install
, and then ran npm test
. If you don't have typescript installed globally you will need to install that as well.
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.
Yeah, I did. Tests just do linting, doesn't actually run the package, right?
Yes it does not run the tests. Must have been thinking about another project. Did you run the tests using a dummy project as suggested in a previous comment?
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.
Added
"outDir": "./dist",
to thetsconfig.json
to keep things clean.
Also set "noEmit": false,
.
@ekremkenter One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
@webstech Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
@webstech Thanks for review, addressed your comments. Can you review it again? |
Looks good. Just waiting for you to verify the tests run okay. The checks run the tests but do not display the log. |
Re-ping @erykwarren, @CarsonF, @webstech: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
@@ -209,3 +210,33 @@ console.log(htmlToText("<h1>Starting foo test</h1><foo>bar</foo>", { | |||
}, | |||
] | |||
})); | |||
|
|||
console.log('Test with linkBrackets false'); | |||
console.log(htmlToText("<a href=\"https://github.com/DefinitelyTyped\">Link</a>"), { |
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.
I ran the tests and they all need to be corrected. The closing )
on this line should be on line 222. The selectors are not being passed to html-to-text
.
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.
@ekremkenter Any chance you can update the tests so we can close this out?
btw, this issue may be of interest. |
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.
See comment on test.
@ekremkenter One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
@ekremkenter Am I missing something here? I'm getting import { htmlToText } from 'html-to-text';
function extractContent(content: string) {
return htmlToText(content, {
ignoreHref: true,
ignoreImage: true,
});
} |
Should the function declare a return type?
|
@tettoffensive fyi, asking an issue type question on a PR request may not get much of a response. The audience is very limited. |
@webstech Yea, I figured it was a bad idea but thought it seemed like an issue with the type, so threw out a hail mary. |
Did adding the return type resolve your problem? |
No, but letting the code sit overnight seemed to fix the problem |
After getting time to figure out the issue I decided to fix it now. |
@ekremkenter I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on May 7th (in a week) if the issues aren't addressed. |
@ekremkenter To keep things tidy, we have to close PRs that aren't mergeable and don't have activity in the last month. No worries, though — please open a new PR if you'd like to continue with this change. Thank you! |
Please fill in this template.
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition: