Skip to content

added script converter#5

Merged
JakeNesler merged 4 commits into
mainfrom
feat-scriptParser
Dec 27, 2025
Merged

added script converter#5
JakeNesler merged 4 commits into
mainfrom
feat-scriptParser

Conversation

@JakeNesler
Copy link
Copy Markdown
Contributor

Summary

Adds script annotation support, image handling, and changes the URL scheme from .md suffix to ?gremllm query parameter.

Script Handling

  • Scripts with data-llm-description attribute are replaced with descriptive text for LLMs
  • Scripts without the attribute are stripped entirely
  • Scripts with data-llm="keep" are preserved
<script data-llm-description="Calculator: add, subtract, multiply, divide"> function calc() { ... } </script>

Image Handling

  • Images are replaced with [Image: alt text] format
  • Images without alt text become [Image] (or removed if RemoveImagesNoAlt=true)

Expanded Default Strip List

  • Now strips: nav, aside, footer, header, script, style, noscript, svg, iframe
  • All can be preserved with data-llm="keep"

URL Scheme Change

  • Before: /index.md → serves processed /index.html
  • After: /index.html?gremllm → serves processed HTML
  • Avoids conflicts with actual .md files
  • Only processes text/html responses with 200 status

Test Plan

  • Existing tests pass
  • New tests for script/image handling
  • Manual testing with example page (/index.html vs /index.html?gremllm)

@JakeNesler JakeNesler merged commit b1bf88e into main Dec 27, 2025
3 checks passed
@JakeNesler JakeNesler deleted the feat-scriptParser branch December 27, 2025 20:36
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