Skip to content

Ensure unhandled directives are restored without any extra whitespace#2281

Merged
delucis merged 2 commits intowithastro:mainfrom
HiDeoo:hd-fix-unhandled-remark-directive-whitespace
Sep 4, 2024
Merged

Ensure unhandled directives are restored without any extra whitespace#2281
delucis merged 2 commits intowithastro:mainfrom
HiDeoo:hd-fix-unhandled-remark-directive-whitespace

Conversation

@HiDeoo
Copy link
Copy Markdown
Member

@HiDeoo HiDeoo commented Sep 3, 2024

Description

This PR fixes an issue reported on Discord where the current process of restoring unhandled directives could change the expected output if the unhandled directive was followed by some characters due to extra whitespace being added.

Assuming the following input:

## Environment variables (astro:env)

Before: (notice the space before the trailing ))

SCR-20240903-qkiu

After:

SCR-20240903-qklg

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 3, 2024

🦋 Changeset detected

Latest commit: 178ff57

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Sep 3, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 3, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 178ff57
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/66d80e863cad99000852988d
😎 Deploy Preview https://deploy-preview-2281--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense — thanks for figuring that out! Left a small note re: performance, but seems solid to me.

@delucis delucis added the 🌟 patch Change that triggers a patch release label Sep 3, 2024
Copy link
Copy Markdown
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With all the time we save avoiding RegExp replaces, I have time to double approve!

@delucis delucis merged commit 5062d30 into withastro:main Sep 4, 2024
@astrobot-houston astrobot-houston mentioned this pull request Sep 4, 2024
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Sep 7, 2024
* main: (37 commits)
  [ci] format
  i18n(ko-KR): update `manual-setup.mdx` (withastro#2294)
  i18n(ko-KR): update `configuration.mdx` (withastro#2295)
  [ci] release (withastro#2292)
  Add support for SSR (withastro#1255)
  Add Markdoc preset and example (withastro#2249)
  Refactor sidebar persistence logic for better slow device performance (withastro#2242)
  [ci] format
  Add docs.ryzekit.com to showcase (withastro#2291)
  Update astro dependency to 4.15.3 across monorepo (withastro#2289)
  [ci] release (withastro#2290)
  Prevent Zod errors from crashing build (withastro#2288)
  i18n(fr): update `guides/css-and-tailwind` (withastro#2286)
  i18n(ko-KR): update `css-and-tailwind.mdx` (withastro#2284)
  Add WCAG AAA colour contrast option to theme editor (withastro#2282)
  [ci] release (withastro#2283)
  Parse `<StarlightPage />` frontmatter asynchronously (withastro#2279)
  Ensure unhandled directives are restored without any extra whitespace (withastro#2281)
  i18n(fr): update `resources/plugins` (withastro#2278)
  i18n(ko-KR): update `plugins.mdx` (withastro#2277)
  ...
Yoxnear pushed a commit to Yoxnear/starlight-custom that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants