filecheck

package
v1.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package filecheck validates that file content is safe to interpret as CalcMark. It provides defense-in-depth against binary files renamed with .cm extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCalcMarkExtension

func IsCalcMarkExtension(path string) bool

IsCalcMarkExtension reports whether the file at path has a recognized CalcMark extension (.cm or .calcmark, case-insensitive).

func IsMarkdownExtension added in v1.8.17

func IsMarkdownExtension(path string) bool

IsMarkdownExtension reports whether the file at path has a recognized Markdown extension (.md or .markdown, case-insensitive).

func ValidateContent

func ValidateContent(data []byte) error

ValidateContent checks that data is valid text suitable for CalcMark. It rejects known binary formats (magic-number check), null bytes, and data that is not valid UTF-8. This is a defense-in-depth measure: even if a file has a .cm extension, its content must be safe to interpret.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL