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

fix(swift) ensure keyword attributes highlight correctly #3955

Merged

Conversation

bradleymackey
Copy link
Contributor

Changes

  • Prevent keyword attributes from greedily matching non-keyword attributes
  • Lookahead to either a trailing whitespace character or an opening paren to ensure matches are exact for the keywords.
  • Prevents issues like @objcMembers being prematurely highlighted as @objc only.
  • Also prevents issues where meta attributes may have the same prefix as a keyword

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md

Copy link

github-actions bot commented Jan 4, 2024

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +32 B

View Changes
file base pr diff
es/core.min.js 8.17 KB 8.17 KB +2 B
es/highlight.min.js 8.17 KB 8.17 KB +2 B
es/languages/swift.min.js 3.54 KB 3.55 KB +13 B
highlight.min.js 8.2 KB 8.21 KB +2 B
languages/swift.min.js 3.54 KB 3.56 KB +13 B

@bradleymackey bradleymackey force-pushed the fix/swift/greedy-attribute-stop branch from e5d2520 to dc8739b Compare January 5, 2024 10:45
Copy link

github-actions bot commented Jan 5, 2024

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

5 files changed

Total change +23 B

View Changes
file base pr diff
es/core.min.js 8.17 KB 8.17 KB -1 B
es/highlight.min.js 8.17 KB 8.17 KB -1 B
es/languages/swift.min.js 3.54 KB 3.55 KB +13 B
highlight.min.js 8.21 KB 8.21 KB -1 B
languages/swift.min.js 3.55 KB 3.56 KB +13 B

Copy link

github-actions bot commented Jan 5, 2024

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

2 files changed

Total change +26 B

View Changes
file base pr diff
es/languages/swift.min.js 3.54 KB 3.55 KB +13 B
languages/swift.min.js 3.55 KB 3.56 KB +13 B

@joshgoebel joshgoebel merged commit c577048 into highlightjs:main Jan 5, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants