chore: remove comment handling

This commit is contained in:
anatawa12 2025-04-06 18:38:01 +09:00
parent 1dcc69ab54
commit 0367545183
No known key found for this signature in database
GPG Key ID: 9CA909848B8E4EA6
1 changed files with 0 additions and 51 deletions

View File

@ -133,10 +133,6 @@ function extractElementText(node: TemplateChildNode): string | null {
const expressionContent = extractExpressionContent(node.children);
if (expressionContent) return expressionContent;
// 4. テキストノードを検索
const textContent = extractTextContent(node.children);
if (textContent) return textContent;
// 5. 再帰的に子ノードを探索
return extractNestedContent(node.children);
}
@ -238,34 +234,6 @@ function extractExpressionContent(children: TemplateChildNode[]): string | null
return null;
}
/**
*
*/
function extractTextContent(children: TemplateChildNode[]): string | null {
for (const child of children) {
if (child.type === NodeTypes.COMMENT && child.content) {
const text = child.content.trim();
if (text) {
logger.info(`Found text node: ${text}`);
// Mustache構文のチェック
const mustachePattern = /^\s*{{\s*(.*?)\s*}}\s*$/;
const mustacheMatch = text.match(mustachePattern);
if (mustacheMatch && mustacheMatch[1] && isI18nReference(mustacheMatch[1])) {
logger.info(`Extracted i18n ref from text mustache: ${mustacheMatch[1]}`);
return '$\{' + mustacheMatch[1] + '}';
}
return text;
}
}
}
return null;
}
/**
*
*/
@ -350,15 +318,6 @@ function extractLabelsAndKeywords(nodes: TemplateChildNode[]): { label: string |
logger.info(`Found i18n in expression: ${label}`);
break;
}
// テキストードでもMustache構文を探す
else if (child.type === NodeTypes.COMMENT && child.content) {
const mustacheMatch = child.content.trim().match(/^\s*{{\s*(.*?)\s*}}\s*$/);
if (mustacheMatch && mustacheMatch[1] && isI18nReference(mustacheMatch[1])) {
label = mustacheMatch[1].trim();
logger.info(`Found i18n in text mustache: ${label}`);
break;
}
}
}
}
}
@ -401,16 +360,6 @@ function extractLabelsAndKeywords(nodes: TemplateChildNode[]): { label: string |
logger.info(`Found i18n keyword in expression: ${keyword}`);
break;
}
// テキストードでもMustache構文を探す
else if (child.type === NodeTypes.COMMENT && child.content) {
const mustacheMatch = child.content.trim().match(/^\s*{{\s*(.*?)\s*}}\s*$/);
if (mustacheMatch && mustacheMatch[1] && isI18nReference(mustacheMatch[1])) {
const keyword = mustacheMatch[1].trim();
keywords.push(keyword);
logger.info(`Found i18n keyword in text mustache: ${keyword}`);
break;
}
}
}
}
}