You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was working on @types/node using the script which generates new type definitions from the node docs, I noticed that node-html-markdown doesn't appear to replace newlines with whitespace when they occur immediately before an <em> tag, which can result in potentially broken markdown.
Here is an example test:
test(`newline before emphasis`,()=>{constres=translate(`The contents of the newly created <code>Buffer</code> are unknown and\n<em>may contain sensitive data</em>.`);constexp=`The contents of the newly created \`Buffer\` are unknown and _may contain sensitive data_.`;expect(res).toBe(exp);});
expect(received).toBe(expected) // Object.is equality
Expected: "The contents of the newly created `Buffer` are unknown and _may contain sensitive data_."
Received: "The contents of the newly created `Buffer` are unknown and_may contain sensitive data_."
49 | );
50 | const exp = `The contents of the newly created \`Buffer\` are unknown and _may contain sensitive data_.`;
> 51 | expect(res).toBe(exp);
| ^
52 | });
53 |
54 | test(`test2`, () => {
at Object.<anonymous> (test/default-tags.test.ts:51:17)
Test Suites: 1 failed, 4 passed, 5 total
Tests: 1 failed, 63 passed, 64 total
Snapshots: 0 total
Time: 5.672 s
I was wondering whether this was a bug or was intentional? Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for the report, Josh! I apologize for the delay. I've been pretty tied up in recent months.
I agree that this shouldn't happen. Whitespace should be replaced by a single space, and broken markdown is never good.
I've got a bit of catching up to do, but I will add this to the list and take a look as soon as I can. If you (or anyone else) is up to it in the interim, PRs are welcome!
When I was working on
@types/node
using the script which generates new type definitions from the node docs, I noticed thatnode-html-markdown
doesn't appear to replace newlines with whitespace when they occur immediately before an<em>
tag, which can result in potentially broken markdown.Here is an example test:
I was wondering whether this was a bug or was intentional? Thanks!
The text was updated successfully, but these errors were encountered: