Skip to content

fix(docs-infra): support header values containing apostrophes#69268

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:support-header-values-containing-apostrophes
Open

fix(docs-infra): support header values containing apostrophes#69268
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:support-header-values-containing-apostrophes

Conversation

@MeAkib

@MeAkib MeAkib commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Update the headerRule regex to capture the complete quoted header value. The previous pattern excluded quote characters from the content and failed to parse headers such as:

The new pattern matches everything between the opening and closing quote delimiters.

What is the current behavior?

Showing Only "Can" not full text.
https://angular.dev/guide/di/debugging-and-troubleshooting-di#trying-to-inject-interfaces

image

What is the new behavior?

Showing full text "Can't inject interface"

Update the `headerRule` regex to capture the complete quoted header value. The previous pattern excluded quote characters from the content and failed to parse headers such as:

```angular-ts {avoid, header: "Can't inject interface"}
```

The new pattern matches everything between the opening and closing quote delimiters.
@pullapprove pullapprove Bot requested a review from MarkTechson June 9, 2026 19:33
@angular-robot angular-robot Bot added the area: docs-infra Angular.dev application and infrastructure label Jun 9, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 9, 2026
const metadataStr = match[2].trim();

const headerRule = /header\s*:\s*(['"`])([^'"`]+)\1/; // The 2nd capture matters here
const headerRule = /header\s*:\s*(['"`])(.*?)\1/; // The 2nd capture matters here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm afraid that's not safe enough.
I would only approve this change we a sufficient test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs-infra Angular.dev application and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants