Skip to content

Handle relative links in LiaScript YAML frontmatter; remove invalid @import pattern#4

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-yaml-header-fields
Draft

Handle relative links in LiaScript YAML frontmatter; remove invalid @import pattern#4
Copilot wants to merge 2 commits intomainfrom
copilot/update-yaml-header-fields

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

The packer missed assets declared in the LiaScript YAML header (e.g. import, link, script, logo) and had a spurious @import regex pattern that doesn't correspond to any real LiaScript syntax.

Changes

  • Removed the @import regex from _LINK_PATTERNS — not a LiaScript feature
  • Added _extract_yaml_frontmatter_links() — lightweight line-by-line parser for the YAML block between --- markers; extracts file references from import, link, script, and logo fields, handling both scalar and list values, quoted or unquoted
  • Integrated YAML extraction into extract_relative_links() before the body regex pass, with shared dedup/absolute-URL filtering

Example

A header like:

---
title: My Course
logo: images/banner.jpg
link:
  - styles/custom.css
import:
  - macros/helpers.md
  - https://cdn.example.com/remote.md   # skipped — absolute
script: js/init.js
---

now correctly adds images/banner.jpg, styles/custom.css, macros/helpers.md, and js/init.js to the ZIP, while ignoring the absolute URL.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Update yaml header to include relative link support Handle relative links in LiaScript YAML frontmatter; remove invalid @import pattern Mar 26, 2026
Copilot AI requested a review from vgoehler March 26, 2026 16:24
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