Skip to content

Make frontmatter module crate-private (pub(crate)) to close unintended public API surface #264

@coderabbitai

Description

@coderabbitai

Summary

In src/lib.rs (Line 31), the frontmatter module is declared with pub visibility:

#[doc(hidden)]
pub mod frontmatter;

Although #[doc(hidden)] suppresses rustdoc output, it does not restrict linkage — external crates can still reach mdtablefix::frontmatter::split_leading_yaml_frontmatter directly via the module path. This unintentionally commits the internal interface to the public API surface.

Required Change

Change the declaration to pub(crate) and drop the now-redundant #[doc(hidden)] attribute:

pub(crate) mod frontmatter;

This fully closes the boundary and makes the intent explicit without any functional change to the library's behaviour.

Background

This was identified during the code review of #263 (Add YAML frontmatter preservation support). The crate-root re-export of split_leading_yaml_frontmatter was removed as part of that PR, but the module declaration itself was not updated.

References

Raised by @leynos.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions