Skip to content

Conversation

Copy link

Copilot AI commented Nov 5, 2025

Per README requirements, implement a library to parse XML metadata files with Include resolution and variable substitution support (${ENV:}, ${MD5:}, ${META:}, ${this:}).

Changes

  • Path handling: Replace hardcoded backslashes with Path.DirectorySeparatorChar for cross-platform compatibility in Include/Module resolution
  • MD5 variable resolution: Implement smart ${MD5::} that computes hash of file referenced in Source attribute when used in Hash attribute
    <Markdown Source="file.md" Hash="${MD5::}"/>
    <!-- Resolves to MD5 hash of file.md -->
  • Nullable safety: Fix nullable reference warnings in environment variable enumeration and path operations

Library API

// Load and parse with Include resolution
var metadata = Metadata.LoadFromFile("metadata.xml");

// Replace variables in-place
metadata.ReplaceVariablesInFile("metadata.xml");

// Compile to merged document
var doc = metadata.Compile();

Supports variable types: ${ENV:VAR}, ${MD5::}, ${MD5:file.txt}, ${META:path:to:element}, ${this:DefineKey}

Original prompt

按照README要求,编写一个负责解析Metadata的库


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…lacement

Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 5, 2025

Deploying ra3battlenet-metadata with  Cloudflare Pages  Cloudflare Pages

Latest commit: f51629e
Status:🚫  Build failed.

View logs

Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Copilot AI changed the title [WIP] Add library for parsing metadata as per README Implement cross-platform Metadata parsing library with variable substitution Nov 5, 2025
Copilot AI requested a review from mrbbbaixue November 5, 2025 15:10
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