Skip to content

Fix code region validation#54

Open
Daniel1464 wants to merge 1 commit into
frcsoftware:mainfrom
Daniel1464:fixCodeRegionValidation
Open

Fix code region validation#54
Daniel1464 wants to merge 1 commit into
frcsoftware:mainfrom
Daniel1464:fixCodeRegionValidation

Conversation

@Daniel1464

@Daniel1464 Daniel1464 commented Jun 29, 2026

Copy link
Copy Markdown

Currently, the codeblock region validation doesn't check if your codeblock is indented in some way (due to being located inside of a <details> or <Aside> block). For instance, this wouldn't be recognized by the validation script:

<Aside>
  Lorem Ipsum....
  ```java stage0/JavaFundamentals.java#myCodeBlock
  
  ```
</Aside>

Because the triple backticks are indented by 2 spaces.

@github-actions

Copy link
Copy Markdown

🌐 Preview URL: https://pr-54.frcsoftware.pages.dev


const START_RE = /^\s*(?:\/\/|#|--|<!--|-->)?\s*\[(\w+)\]\s*$/;
const END_RE = /^\s*(?:\/\/|#|--|<!--|-->)?\s*\[\/(\w+)\]\s*$/;
const CODEBLOCK_RE = /^```\w+\s+(\S+)#(\w+)/;

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.

Do you think it would be better to leave the exact match (^) at the start and add a zero or more white space match?

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