greasyfork-org / greasyfork

An online repository of user scripts.
https://greasyfork.org
GNU General Public License v3.0
1.41k stars 423 forks source link

Diff page should escape new lines `\n` #1183

Closed nexushoratio closed 9 months ago

nexushoratio commented 9 months ago

Probably worth testing all backslash escapes.

https://greasyfork.org/en/scripts/472097-linkedin-tool/diff?v1=1257673&v2=1257136

At the bottom of the page, it reads like this:

-              this._log.log('via attributes', record.target, `
-old: ${oldValue}
-new:${newValue}`);
+              this.logger.log('via attributes', record.target, `
+old: ${oldValue}
+new:${newValue}`);

The change here on GH is actually:

 -             this._log.log('via attributes', record.target, `\nold: ${oldValue}\nnew:${newValue}`);
 +             this.logger.log('via attributes', record.target, `\nold: ${oldValue}\nnew:${newValue}`);

The code view (currently line 2800), renders fine (well, outside of the fact that template literals are not called out at all).

JasonBarnabe commented 9 months ago

This is https://github.com/samg/diffy/issues/113.