mdrip icon indicating copy to clipboard operation
mdrip copied to clipboard

[minor] make filter.go Markdown determination more granular

Open jayunit100 opened this issue 10 months ago • 0 comments

Problem Statement

It appears - mdrip print - checks files for their suffixes, which means you can't extract md from non .md files,

i.e. in internal/loader/filter.go:

        if filepath.Ext(info.Name()) != ".md" {
                return NotMarkDownErr
        }

Solution

Maybe pre-parse / validate a markdown file instead of checking its syntax.

Background

When debugging a series of markdown scripts, i started making temp files , named funny things like "try-1" , and "try-2". I didnt want MDRip to parse them by default, but i DID want to use mdrip imperatively to generate scripts from them via mdrip print.

jayunit100 avatar Apr 16 '25 02:04 jayunit100