qubit_json/options/markdown_fence_closing.rs
1// =============================================================================
2// Copyright (c) 2025 - 2026 Haixing Hu.
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6// Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Defines the closing-fence requirement for Markdown fence normalization.
9
10/// Specifies whether an opening Markdown code fence needs a closing fence.
11///
12/// # Examples
13///
14/// ```compile_fail
15/// #![deny(unused_must_use)]
16/// use qubit_json::MarkdownFenceClosing;
17///
18/// fn closing_policy() -> MarkdownFenceClosing {
19/// MarkdownFenceClosing::Optional
20/// }
21///
22/// closing_policy();
23/// ```
24#[must_use]
25#[non_exhaustive]
26#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
27pub enum MarkdownFenceClosing {
28 /// Accepts an opening fence even when no matching closing fence is present.
29 Optional,
30 /// Requires a matching closing fence before stripping the outer fence.
31 Required,
32}