Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
feat: add check for 'budoux' in context string
Browse files Browse the repository at this point in the history
Added a check to ensure that the context string contains 'budoux' before
proceeding with the transformation. This prevents unnecessary processing
when 'budoux' is not present in the context string.
  • Loading branch information
ryoppippi committed Aug 24, 2024
1 parent 78dac72 commit 417e2d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export function budouxCodeblock(
defaultLanguage: Language = 'ja',
): (ctx: MarkdownTransformContext) => void {
return (ctx: MarkdownTransformContext) => {
if (!ctx.s.toString().includes('budoux')) {
return;
}

/* Replace the content of the budoux tags */
languages.forEach((lang) => {
const parser = getParser(lang);
Expand Down

0 comments on commit 417e2d6

Please sign in to comment.