question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

styling {injector} is broken in Safari

See original GitHub issue

Renderer

v3

Browser

Safari

Operating System

MacOS

What happened?

Loading any page causes Safari to fail incomplete.

An error in the console leads to this: image

The source is https://github.com/naturalcrit/homebrewery/blob/ee05392d27ce76999b95bfb8f990d17a1e6d2b1a/client/homebrew/editor/editor.jsx#L142

The regex for styling {injectors} begins with a negative look-behind, but that is not supported in Safari per https://caniuse.com/js-regexp-lookbehind

Suggestion: this (?<!{) be changed to a non-capturing group (?:[^{]?) — that is, the {injector} pattern should be preceded with zero-or-one character which is not a {.

Code

# heading
{injector}

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
calculuschildcommented, Nov 30, 2022

We probably need something more like https://regex101.com/r/H674QD/2

0reactions
Gazook89commented, Dec 1, 2022

I think this does it:

const regex = /(?:^|[^{|\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\2})/gm;
let match;
while ((match = regex.exec(line)) != null) {
    codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length }, { className: 'injection' });
}

regex101 link

I’ll put a PR up in a minute.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Safari Extension CSS Injection not loading - Stack Overflow
Show activity on this post. I built a Safari Extension in XCode from scratch. The main goal was to hide the video recommendations...
Read more >
Replacing Spider Fuel Injector or regulator step by step vid
This video one of the best ever, step by step on how to change your spider injector or fuel regulator from under the...
Read more >
GM Spider Injection Replacement - YouTube
How To Replace the spider fuel injection system on a Vortec GM engine. ... 4.3 5.0 and 5.7 vortec engines have spider injectors....
Read more >
how do I get rid of the ad-injector quick… - Apple Discussions
I have google it, and the only answer I can find says to delete the malware from the extensions under the preference under...
Read more >
The Tata Safari 2.2L Technical / Problems Thread - Page 399
The Delphi injectors are very sensitive to bad fuel. ... Mirror glass is fine- the pivot (swivel joint with base) is broken :-( ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found