sindresorhus/refined-github

Hide-markdown-diff not hiding all changed #4035

privatenumber posted onGitHub

<!-- Thanks for reporting a bug! ⛰ 1. Make sure the bug is caused by Refined GitHub. Try disabling the extension first. 2. Include a full URL where the bug appears. 3. Include a screenshot/gif Issues without a URL/screenshot will be closed -->

Description

The hide-markdown-diff is not hiding all changes in the final result preview, and effectively shows an inaccurate result.

My changes

Before

> _💁‍♀️ Protip: Use the minify plugin in-place of the loader to transpile your JS_
>
> The `target` option tells _esbuild_ that it can use newer JS syntax to perform better minification. If you're not using TypeScript or any syntax unsupported by Webpack, you can also leverage this as a transpilation step. It will be faster because there's less files to work on and will produce a smaller output because the polyfills will only be bundled once for the entire build instead of per file.

After

#### _💁‍♀️ Protip: Use the minify plugin in-place of the loader to transpile your JS_
The `target` option tells _esbuild_ that it can use newer JS syntax to perform better minification. If you're not using TypeScript or any syntax unsupported by Webpack, you can also leverage this as a transpilation step. It will be faster because there's less files to work on and will produce a smaller output because the polyfills will only be bundled once for the entire build instead of per file.

Screenshots

Github default preview

<img width="1031" alt="Screen Shot 2021-02-27 at 7 31 13 PM" src="https://user-images.githubusercontent.com/1075694/109404275-89134800-7932-11eb-9a2f-7f05812a9989.png">

With "View final result" toggled

<img width="1074" alt="Screen Shot 2021-02-27 at 7 31 01 PM" src="https://user-images.githubusercontent.com/1075694/109404278-89abde80-7932-11eb-8c10-e55c6a18c2d8.png">

Problems

  • The "Protip: ..." is duplicated
  • Spacing on the first "Protip: ..." is off
  • "target" is highlighted

If GitHub’s diff doesn’t make this easy, we have 2 options:

  • drop the feature
  • add a notice about its possible looseness

If we can detect a situation when this happens (e.g. if there’s a yellow diff?) we can display the message only in that case.

posted by fregante about 4 years ago

The indentation and highlighting are easy enough to get rid of, but I don't understand why the second "Protip: […]" line isn't wrapped in a <del> element. Could this be a bug in GitHub's diff algorithm?

posted by cheap-glitch about 4 years ago

Yeah that’s what I meant, the diff isn’t reliable enough and thus we need a notice. It’s not our fault

posted by fregante about 4 years ago
  • "target" is highlighted

We can fix this + add a notice (that should appear on next to the buttons probably)

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests