Skip to main content

qubit_json/decode/
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 lenient Markdown fence
9//! normalization.
10
11/// Specifies whether an opening Markdown code fence needs a closing fence.
12///
13/// # Examples
14///
15/// ```
16/// use qubit_json::decode::MarkdownFenceClosing;
17///
18/// let closing_policy = MarkdownFenceClosing::Optional;
19/// assert_eq!(closing_policy, MarkdownFenceClosing::Optional);
20/// ```
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
22pub enum MarkdownFenceClosing {
23    /// Accepts an opening fence even when no matching closing fence is present.
24    Optional,
25    /// Requires a matching closing fence before stripping the outer fence.
26    Required,
27}