Skip to content

Conversation

@guuido
Copy link
Contributor

@guuido guuido commented Nov 4, 2024

Fixes wrong escaping behavior in single-quoted strings

Resolves #4068

Changes

Before, backslashes in single-quoted strings were incorrectly treated as escape characters:

image

Now single-quoted strings follow YAML specification where only single quotes can be escaped (by doubling them):

image

Checklist

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

@github-actions
Copy link

github-actions bot commented Nov 4, 2024

Build Size Report

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

2 files changed

Total change +38 B

View Changes
file base pr diff
es/languages/yaml.min.js 876 B 895 B +19 B
languages/yaml.min.js 877 B 896 B +19 B

@joshgoebel
Copy link
Member

Lets also make sure we add a single quote escaping to our markup tests - esp if we go with char.escape.

@github-actions
Copy link

github-actions bot commented Nov 6, 2024

Build Size Report

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

2 files changed

Total change +68 B

View Changes
file base pr diff
es/languages/yaml.min.js 876 B 910 B +34 B
languages/yaml.min.js 877 B 911 B +34 B

@guuido guuido requested a review from joshgoebel November 6, 2024 10:51
@joshgoebel joshgoebel merged commit e11c88b into highlightjs:main Nov 6, 2024
19 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.

(YAML) Handling of '\'

2 participants