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

Bump turndown from 6.0.0 to 7.1.1 #243

Merged
merged 3 commits into from
Sep 8, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 31, 2022

I think there's a problem with this release, see the comment below. We'll need to find some time to look into it - Kevin


Bumps turndown from 6.0.0 to 7.1.1.

Release notes

Sourced from turndown's releases.

v7.1.1

  • Upgrade rollup. Fix #387. 9ad4c1b

mixmark-io/turndown@v7.1.0...v7.1.1

v7.1.0

  • Add mixmark-io update info. 08ea6d6
  • Update deps. c1b11a3
  • Update SECURITY.md ef41a54
  • Update SECURITY.md 2d68b76
  • Create SECURITY.md b30d120
  • Merge pull request #372 from orchitech/npm-prepare 24070bc
  • Fix build when used as git-linked dependency. c11f982
  • Merge pull request #371 from orchitech/fix-inefficient-whitespace-join 46e6ffa
  • Avoid match-at-end regexp bottleneck in replacement to output joining. Fix #370. 0f9129c
  • Merge pull request #319 from orchitech/preformatted-code e7a9351
  • Add support for interpreting <code> as a preformatted inline element and rendering Markdown accordingly. Fix #318. fc0d49f
  • Merge pull request #317 from orchitech/code-span-rule-fix 04e499e
  • Merge pull request #335 from orchitech/fix-browser-modules-export d741a1d
  • Merge pull request #315 from orchitech/flanking-whitespace-improvements dcf2cf6
  • Fix browser modules export. Fixes domchristie/turndown#334. 8d71a2d
  • Follow CommonMark spec more precisely and make the code span rule even more robust for future Turndown development. Fix #316. 68a22b6
  • Respect original whitespace instead of using hardcoded 0x20. Do not merge ASCII and non-ASCII whitespace. Make sure non-ASCII whitespace is moved out of inline elements to prevent generating broken Markdown. Fix #102. Fix #250. 27bdac0

mixmark-io/turndown@v7.0.1...v7.1.0

v7.0.1

v7.0.0

Same as v7.0.1 but the npm package includes build files that should be ignored. Use v7.0.1

Commits
Maintainer changes

This version was pushed to npm by martincizek, a new releaser for turndown since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Aug 31, 2022
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/turndown-7.1.1 branch from cc4537e to 0a93dfc Compare September 6, 2022 14:31
Bumps [turndown](https://github.com/domchristie/turndown) from 6.0.0 to 7.1.1.
- [Release notes](https://github.com/domchristie/turndown/releases)
- [Commits](mixmark-io/turndown@v6.0.0...v7.1.1)

---
updated-dependencies:
- dependency-name: turndown
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/turndown-7.1.1 branch from 0a93dfc to e391fe9 Compare September 6, 2022 15:28
Turndown 7 seems to resolve the problem that we added this extra code
for. It caused the test to fail because it used a non-breaking space
character rather than a regular space.

Since we no longer need the code we should also remove the test.
@kevindew
Copy link
Member

kevindew commented Sep 8, 2022

There seems to be a problem with non-breaking spaces with this, which breakes the MS word comment removal test.

I distilled it into a test locally:

it('resolves even more duplicated whitespace inside an empty element', () => {
  const html = 'Some text <span>&nbsp;</span> and some more text'
  expect(htmlToGovspeak(html)).toEqual('Some text and some more text')
})

This fails with:

expect(received).toEqual(expected) // deep equality

    Expected: "Some text and some more text"
    Received: "Some text   and some more text"

Not too sure why though :-/

I imagine it's a similar problem to: mixmark-io/turndown#281 but I ran out of time looking at it.

This deals with a part of turndown which is somewhat inelegant, if we
remove an element that starts or ends with a non-breaking space it will
be interpreted as trailing or leading whitespace of the node and
included in output. Rather than removed as one might expect.

For example:

```
const service = new TurndownService()
service.remove('span')
service.turndown('test <span><span><span>a &nbsp;</span>b &nbsp;</span>c &nbsp;</span>test')
=> 'test   test'
service.turndown('test <span><span><span>a</span>b</span>c</span>test')
=> 'test test'
service.turndown('test <span><span><span>a </span>b </span>c </span>test')
=> 'test  test'
```

This seems to be intentional changes to Turndown as per:
mixmark-io/turndown@27bdac0
though it is quite confusing.

This seems to be the case with Microsoft word comments that we want to
remove entirely, however they end up with a trailing non-breaking space
character.

This code adjusts the node at the point of conversion to remove any nbsp
whitespace. It wouldn't surprise me hugely if there were other problems
related to this that occur, but I can't think of any.
@kevindew kevindew merged commit e2281ec into main Sep 8, 2022
@kevindew kevindew deleted the dependabot/npm_and_yarn/turndown-7.1.1 branch September 8, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant