use super::ParserState;
#[cfg(feature = "setext")]
pub(crate) fn char_to_level(ch: char) -> Option<u8> {
match ch {
'=' => Some(0),
'-' => Some(1),
'~' => Some(2),
'^' => Some(3),
'+' => Some(4),
_ => None,
}
}
#[cfg(not(feature = "setext"))]
pub(crate) fn char_to_level(_ch: char) -> Option<u8> {
None
}
#[cfg(feature = "setext")]
pub(crate) fn width_ok(title_width: usize, underline_width: usize) -> bool {
title_width.abs_diff(underline_width) <= 2
}
#[cfg(not(feature = "setext"))]
pub(crate) fn width_ok(_title_width: usize, _underline_width: usize) -> bool {
false
}
#[cfg(feature = "setext")]
pub(crate) fn is_enabled(state: &ParserState) -> bool {
state.options.setext
}
#[cfg(not(feature = "setext"))]
pub(crate) fn is_enabled(_state: &ParserState) -> bool {
false
}